I have tested the following bit of code using memprof, with perl, version 5.005_03 built for i386-linux and it leaks 4 bytes on each invocation of test().
Interestingly if you change the assignment of
to a number (e.g.
) - no leak!
Can any one tell me why the following snippet of code leaks (I ran with: memprof -- perl foo.pl) ?