in reply to Strange memory growth?
Oddly enough, this doesn't happen if you do:
foreach 1..6 { my $foo = "perl" x 1000000; sleep 5; }
So, it would seem that Perl doesn't know to reclaim if it is a different scope.
Surprisingly, the following also "loses" memory:
Uses about 28 Mb at the end (the original uses 48 Mb).my $foo; if (1) { $foo = "perl" x 1000000; sleep 5; } if (1) { $foo = "perl" x 1000000; sleep 5; } if (1) { $foo = "perl" x 1000000; sleep 5; } if (1) { $foo = "perl" x 1000000; sleep 5; } if (1) { $foo = "perl" x 1000000; sleep 5; } if (1) { $foo = "perl" x 1000000; sleep 5; }
Maybe something for 5.8.3 to look at ;-)
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Strange memory growth?
by meetraz (Hermit) on Nov 07, 2003 at 20:52 UTC | |
|
Re: Re: Strange memory growth?
by Anonymous Monk on Nov 07, 2003 at 23:31 UTC | |
by hardburn (Abbot) on Nov 08, 2003 at 02:19 UTC | |
by ambrus (Abbot) on Nov 14, 2003 at 20:00 UTC |