[Pdx-pm] Recommendations for memory leak checking?

Kevin Scaldeferri kevin at scaldeferri.com
Wed Jul 4 10:38:28 PDT 2007

On Jul 4, 2007, at 12:47 AM, Eric Wilhelm wrote:

> # from Kevin Scaldeferri
> # on Tuesday 03 July 2007 11:21 pm:
>>>   BEGIN {do {"./t/this.t"}; }
>>>   END { print STDERR ">>>THIS IS THE END<<<\n";}
>>>   *UNIVERSAL::DESTROY = sub {
>>>     print STDERR "$_[0] is leaky\n";
>>>   };
>> I think that would only detect leaks of objects, right?  I'd like to
>> detect leaks of normal variables as well.
> Yep, only objects.  That suggestion is also limited in that it would
> need to be told "oh, those are ok" if there's a package lexical or
> package global being destroyed at the END.  (And from a simple test,
> there are going to be some IO::Handle objects and other bits of
> non-trivial magic appearing.)
> The code has circular references in lexical non-objects?  That's just
> frightening.

As I mentioned at the end of my last message, there is no "the  
code".  Essentially, I'm designing Makefiles for general use.

However, the last time I was trying to do memory leak debugging of  
Perl, a couple years ago, the tools which only detected object leaks  
proved not to find anything in the codebase I was working with.  The  
tools which detected general variable leaks found lots of stuff.   
Now, I don't want to particularly defend the quality of that  
codebase, but it's just an example of why I don't want to be limited  
to only object leak detection.


More information about the Pdx-pm-list mailing list