in reply to Re^2: help with memory leak
in thread help with memory leak
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: help with memory leak
by crunch_this! (Acolyte) on Apr 18, 2013 at 18:31 UTC | |
by kcott (Archbishop) on Apr 18, 2013 at 19:37 UTC | |
|
Re^4: help with memory leak
by crunch_this! (Acolyte) on Apr 18, 2013 at 21:14 UTC | |
by kcott (Archbishop) on Apr 18, 2013 at 21:58 UTC | |
by crunch_this! (Acolyte) on Apr 18, 2013 at 23:17 UTC |