Don't worry about uname. What you've shown indicates we're using the same Perl version but completely different OSes: I'm using Mac OS X; you're using MS Windows.
Be aware how the number of iterations grows with respect to $rep: 4 = 4; 5 = 10; 10 = 120; 20 = 1140; 100 = 161700; and so on.
You didn't indicate how the code changes affected the leaks. My tests still show no leaks — I'm unable to reproduce your problem.
I can't see any leak-related isues with %haystack; although, that doesn't mean there aren't any. I do note that you're populating @wants twice with what appears to be the same data:
my @wants = grep { is_approximately_an_integer( @$_ ) } values %haysta +ck; # intervening comments here only @wants = grep { is_approximately_an_integer( @{$haystack{$_}} ) } keys + %haystack;
Obviously, you only want one of those. Also, if %haystack is only used to populate @wants (you don't show any other usage in your code), consider whether the is_approximately_an_integer() filter might be better placed in the innermost loop (possibly doing away with %haystack altogether).
-- Ken
In reply to Re^3: help with memory leak
by kcott
in thread help with memory leak
by crunch_this!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |