in reply to (tye)Re: Tracking Memory Leaks
in thread Tracking Memory Leaks
No, I don't think that's correct. The memory will not be freed, if by freed you mean "available for use by other variables in my program". It will be re-used if you use that lexical again. See this post from Doug MacEachern for more info on this.
I'm not sure the closures thing I was talking about is really a bug; it's just a side-effect of nested subs and closures. If you do this, it will leak like crazy:
my $foo; sub bar { sub baz { $foo++; } }
It's creating a new private copy of $foo for baz() every time. Using Error.pm can sometimes lead people to do this without realizing it, when they use nested try/catch blocks.
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)Re2: Tracking Memory Leaks
by tye (Sage) on Aug 15, 2001 at 23:02 UTC | |
by perrin (Chancellor) on Aug 15, 2001 at 23:35 UTC |