[Catalyst-dev] Need help debugging Text::ASCIITable

Perrin Harkins perrin at elem.com
Mon Sep 26 19:20:48 CEST 2005


On Mon, 2005-09-26 at 11:41 -0400, Andy Grundman wrote:
> Actually I still think it's a valid test, and so far the only way I can 
> detect the memory leak.

You probably really do have a leak, but I would change the test to use
$x and not $t in the beginning.  Assigning a new instance to the same
variable over and over should not increase the size even if you do it
enough to be pretty sure of triggering Perl to fetch more memory.  This
stuff is really slippery though.  How do we know if GTop counts the size
of $final or not?  Eek.

Maybe one of the Devel-Leak* modules would be helpful too?

> If you comment out the tie in new(), the test will pass.

That makes sense.  In fact that tie() and the TIEARRAY method itself
both look like Really Bad Ideas to me.  I'd suggest either significantly
changing how the tie() stuff is implemented, or making it optional and
documenting the leak.

There are some tips for handling circular references safely in this
article by Matt Sergeant:
http://perl.com/pub/a/2002/08/07/proxyobject.html

- Perrin




More information about the Catalyst-dev mailing list