in reply to Re^4: help with memory leak
in thread help with memory leak

Going back to the Test::LeakTrace documentation, specifically the part I quoted in my original response, you'll see: "Thus, to trace true leaks, no_leaks_ok() ...". So, if the documentation is to be believed, and no_leaks_ok() is showing no leaks with the modified code, then it would follow that you now have no true leaks. Problem solved!

In your code, the only use you show for %haystack is to conditionally populate @wants. So, rather than coding:

my %haystack; ... $haystack{"$x, $y, $z"} = [ poly_roots( ... my @wants = grep { is_approximately_an_integer( @$_ ) } values %haysta +ck;

I'm suggesting you do something like this (which does away with %haystack altogether):

my @wants; ... push @wants, grep { is_approximately_an_integer( @$_ ) } [ poly_roots( ...

-- Ken