From owner-freebsd-questions Wed Jul 8 20:40:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA16511 for freebsd-questions-outgoing; Wed, 8 Jul 1998 20:40:12 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from scifair.acadiau.ca (scifair.acadiau.ca [131.162.160.32]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA16462 for ; Wed, 8 Jul 1998 20:40:08 -0700 (PDT) (envelope-from miker@scifair.acadiau.ca) Received: from localhost (miker@localhost) by scifair.acadiau.ca (8.8.5/8.8.5) with SMTP id AAA22649 for ; Thu, 9 Jul 1998 00:40:07 -0300 (ADT) Date: Thu, 9 Jul 1998 00:40:07 -0300 (ADT) From: Michael Richards To: questions@FreeBSD.ORG Subject: Perl running out of memory at the 16M mark Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi peoples... I have an teresting perl problem. I would post it to a perl group, but I suspect the problem is the user limits. Here is a simple script that causes the perl interpreter to die: [root@frodo projects]# cat test.pl #!/usr/local/bin/perl $|=1; for ($i=0;$1<160;$i++) { $test[$i]='a' x 100000; print "size is ".$i."00000\n"; } [root@frodo projects]# !limits limits -U root -B Resource limits for class root: cputime infinity secs filesize infinity kb datasize infinity kb stacksize infinity kb coredumpsize infinity kb memoryuse-max infinity kb memoryuse-cur 131072 kb memorylocked infinity kb maxprocesses-max infinity maxprocesses-cur 64 openfiles-max infinity openfiles-cur 1024 [root@frodo projects]# ./test.pl size is 000000 size is 100000 size is 200000 ... size is 16000000 Out of memory! [root@frodo projects]# Does anyone care to point out the error? I have read the man page for limits until I was blue, and I think I am running it correctly. I am root here anyway. The machine has 128 megs of RAM and oodles free swap. It is a 2.2.5-release box with the latest perl 5.004 installed. -Mike To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message