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 ); }
In reply to (tye)Re: Perl Memory Leak ??
by tye
in thread Perl Memory Leak ??
by eformat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |