http://www.perlmonks.org?node_id=562690


in reply to Re^2: tracking down a memory leak in $_
in thread tracking down a memory leak in $_

If the data that you put in $_ or any other variable becomes larger at some point, then the memory grows, and it stays larger. The memory will get reused for that variable, but it won't be returned.

One thing that often bites people is that reading a nested hash can create hash keys and use more memory. For example:

$foo{bar}->{baz}->{quux};
If there was no baz key before, there is now, and that takes some space.