in reply to Leak Hunting

First, I don't think you want to set up %tick_inf outside the foreach loop like that. If it's only used within the scope of a single pass through the loop, declare it inside the loop. And I think you want to clear the has by saying %tick_inf = () rather than undef'ing it, but I'm not certain about that.

Now, as for finding your leak, you have to do this the old-fashioned way: take stuff out until the problem goes away. Comment out a section of code, run the program, see if it still gets large or not. Keep doing that until you find the part that is making it grow. Then come back and get help fixing that specific piece.