Subject: pkg/22129: Perl-Problem with big hashes
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cavac@grumpfzotz.org>
List: netbsd-bugs
Date: 07/13/2003 14:28:17
>Number:         22129
>Category:       pkg
>Synopsis:       Perl fails when handling big hashes
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 13 13:05:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Rene Schickbauer
>Release:        NetBSD 1.6.1
>Organization:
>Environment:
	
	
System: NetBSD gandalf 1.6.1 NetBSD 1.6.1 (GENERIC) #0: Wed Jun 25 19:55:49 CEST 2003 root@gandalf:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
>How-To-Repeat:

	Perl runs out of memory when using large hashes. Can't be, there is 512MB Ram in the system plus nearly another 2Gig swap.

	bash-2.05b$ cat test.pl
	#!/usr/pkg/bin/perl

	for($outerLoop = 1; $outerLoop<110000; $outerLoop++) {
		$HashKey = "A $outerLoop A";
		$HashData = "B $outerLoop B";
		#Generate larger hash
		for($innerLoop = 1; $innerLoop<10; $innerLoop++) {
			$HashKey = "$HashKey $HashKey ";
			$HashData += "$HashData $HashData ";
		}
		$MyHash{$HashKey} = $HashData;
	}

	bash-2.05b$ perl test.pl
	Out of memory during request for 5644 bytes, total sbrk() is 132347904 bytes!

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: