Newsgroups: comp.lang.perl
Path: utzoo!utgpu!cunews!bnrgate!bwdls61.bnr.ca!bwdls35!gwaters
From: gwaters@bwdls35.bnr.ca (Glenn Waters)
Subject: Perl process size grows and grows
Message-ID: <1990Nov7.200342.12853@bwdls61.bnr.ca>
Keywords: leak, confused
Sender: usenet@bwdls61.bnr.ca (Use Net)
Reply-To: gwaters@bwdls35.bnr.ca (Glenn Waters)
Organization: Bell-Northern Research
Date: Wed, 7 Nov 90 20:03:42 GMT

When the following program is run the process size keeps growing.
I do not understand why. Actually, I must run a loop much larger than
10000 and then I run out of swap when running this program!

				  SIZE
                                   |
				   V
13879 p2 S     0:00  0  1      0  100  444    xx  7.7  1.9 perl ttt
13884 p2 S     0:00  0  0      0   32  180    xx  0.0  0.8 grep perl
13879 p2 R     0:02  0  5      0 1660  448    xx 52.8  1.9 perl

The broken program...

#!/usr/local/bin/perl
@name = ("name1", "name2", "name3", "name4");

&dum (*name);

system ("ps -acxv | grep 'UID'");
system ("ps -vacx | grep 'perl'");
for ($i = 0; $i < 10000; $i++)
{
  &dum (*name);
}
system ("ps -acxv | grep 'perl'");

#********* Sub Dum ********
sub dum
{
  local (*anything) = @_;
}
-- 
Glenn Waters, Network Systems Support         gwaters@bnr.ca
Bell-Northern Research, Ltd.                  ...!uunet!bwdls35!gwaters
P.O. Box 3511, Station C                      (613)763-3933 (Voice)
Ottawa Ontario Canada K1Y 4H7                 (613)763-3283 (FAX)
#include <disclaimer.h>
