in reply to Perl Memory Leak ??
Memory size growing by 4 bytes each iteration of only 11 iterations is pretty scanty evidence of a leak. Perhaps you only posted a minimal test case and you have a larger test case that shows that the leak continues. But it is perfectly reasonable for the above code to grow slightly in memory size until things "settle in".
In contrast, this code:
showed no increase in memory size over the course of about a minute (as well as being a CPU pig). If it were growing 4 bytes per iteration, then it would certainly have been obvious in that amount of time. Of course, this could be because my version of Perl (5.6.0, Win32) is different than yours and your version has a leak and mine doesn't.sub test { $_[0]= 'foo'; } while( 1 ) { test(); }
A more reasonable test case for you to work with might be:
and to see if your memory size grows 4KB per second for many seconds. - tye (but my friends call me "Tye")sub test { $_[0]= 'foo'; } while( 1 ) { for(1..1024) { test(); } sleep( 1 ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: Perl Memory Leak ??
by eformat (Initiate) on Dec 05, 2001 at 20:56 UTC | |
by perrin (Chancellor) on Dec 05, 2001 at 21:46 UTC | |
by eformat (Initiate) on Dec 05, 2001 at 22:34 UTC | |
by dragonchild (Archbishop) on Dec 05, 2001 at 22:52 UTC | |
by tye (Sage) on Dec 06, 2001 at 00:33 UTC | |
by eformat (Initiate) on Dec 06, 2001 at 14:19 UTC | |
by eformat (Initiate) on Dec 06, 2001 at 15:42 UTC |