Re: How to debug POE based app and find memory leak
Gabor Szabo <[email protected]> Wed, 25 Apr 2012 12:30:02 +0300
| Newsgroups | gmane.comp.lang.perl.poe |
|---|---|
| Message-ID | <CABe4FJCJVYWGu=tVX0qsftMpE1t7JfSnjXuMJVnLB9Bex8V4Jg@mail.gmail.com> |
On Wed, Apr 11, 2012 at 4:41 PM, Nick Perez <[email protected]> wrote: > > It depends on where the leak might be. POE has fantastic facilities to > tracing its own inner workings including sessions that might be > sticking around. Take a look in POE::Kernel for turning on some of this > information. From my own experience on debugging memory leaks in POE > applications it is typically two places: sessions that don't get GC'd > (zombies), and the heaps in those sessions with ever growing > numbers of keys. After that, you might end up with a cyclic reference > somewhere that doesn't get cleaned up, so you can use Devel::Cycle. > Without looking the code, it is difficult to give you any more pointers. Thanks for the response. After a long fight it seems the leak is in HTML::TreeBuilder Reading its documentation I see it is not enough to let the object go out of scope. One needs to call ->delete in order to free up the memory. So this was actually unrelated to POE. regards Gabor