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


in reply to Re^2: Tracking down memory leaks
in thread Tracking down memory leaks

That's what I was thinking too. The fact that memory usage slowly grows until the OS kills it is not good. The files I am processing have fairly short lines and it processes the files line by line in a loop. All of the variables inside that loop should be "reusing" the same space, right? Otherwise, what is the point of scoping at all.

Scott
Project coordinator of the Generic Model Organism Database Project

Replies are listed 'Best First'.
Re^4: Tracking down memory leaks
by perrin (Chancellor) on Apr 13, 2005 at 13:39 UTC
    All of the variables in that loop will retain their memory between calls and reuse it. However, if you leave that loop, they will still retain that memory. Also, if you load one of them once with 10MB of data, it will stay at that size until perl exits unless you explicitly undef it when you're done with it.
Re^4: Tracking down memory leaks
by Joost (Canon) on Apr 13, 2005 at 13:01 UTC