Skip Menu |

This queue is for tickets about the HTML-ExtractMain CPAN distribution.

Report information
The Basics
Id: 63633
Status: open
Priority: 0/
Queue: HTML-ExtractMain

People
Owner: ANIRVAN [...] cpan.org
Requestors: guthrie.david [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: HTML::ExtractMain mem leak
Date: Mon, 6 Dec 2010 02:16:10 +0000
To: bug-html-extractmain [...] rt.cpan.org
From: David Guthrie <guthrie.david [...] gmail.com>
Hi Anirvan, I have been using your ExtractMain module for perl. It works very well, but seems to have a memory leak and does not release its memory. Repeated calls to the module will slowly eat up all memory. I am not sure but it looks like this is probably do to the fact that you use create an HTML tree without releasing it as the module requires. You call HTML::TreeBuilder->new without ever calling the ->delete method. A nice way to take care of the clean up when the variable goes out of scope is to use the Object::Destroyer cpan module. use Object::Destroyer my $tree = HTML::TreeBuilder->new; my $sentry = Object::Destroyer->new($tree, 'delete'); For more info see: http://www.perl.com/pub/2007/06/07/better-code-through-destruction.html
David, thanks for the diagnosis and suggested fix. I'm away from a computer for a few days, but will try to push out an update this weekend. I appreciate your great bug report.
I fixed the problem as suggested. David, thanks for your help! The update is making way its way onto CPAN.
Subject: Re: [rt.cpan.org #63633] HTML::ExtractMain mem leak
Date: Tue, 14 Dec 2010 00:42:52 +0000
To: bug-HTML-ExtractMain [...] rt.cpan.org
From: David Guthrie <guthrie.david [...] gmail.com>
Great, I am looking forward to using it. I had a look at your code briefly, I noticed you also call ->detach(), so I believe that that instance will need to be explicitly deleted as well (separately). Best, David On 14 Dec 2010, at 00:02, Anirvan Chatterjee via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=63633 > > > I fixed the problem as suggested. David, thanks for your help! The > update is making way its way onto CPAN.
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #63633] HTML::ExtractMain mem leak
Date: Mon, 13 Dec 2010 18:35:41 -0800
To: David Guthrie via RT <bug-HTML-ExtractMain [...] rt.cpan.org>
From: Anirvan Chatterjee <anirvan [...] chatterjee.net>
On Mon, Dec 13, 2010 at 07:43:05PM -0500, David Guthrie via RT wrote: Show quoted text
> Great, I am looking forward to using it. I had a look at your code briefly, I noticed you also call ->detach(), so I believe that that instance will need to be explicitly deleted as well (separately).
Thanks, David. I fixed the bug, and verified that there were no more leaks using Devel::Leak::Object. Uploading the fix now.