Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Another "out of memory!" problem

by jau (Hermit)
on Jun 23, 2010 at 09:29 UTC ( #846041=note: print w/ replies, xml ) Need Help??


in reply to Another "out of memory!" problem

My guess would be that you are leaking memory because you are not destroying your HTML::Treebuilder objects properly. From the docs:

4. and finally, when you're done with the tree, call $tree->delete() to erase the contents of the tree from memory. This kind of thing usually isn't necessary with most Perl objects, but it's necessary for TreeBuilder objects. See HTML::Element for a more verbose explanation of why this is the case.

A simple undef() is not enough.


Comment on Re: Another "out of memory!" problem
Download Code
Replies are listed 'Best First'.
Re^2: Another "out of memory!" problem
by slugger415 (Scribe) on Jun 24, 2010 at 00:26 UTC
    Hi jau, yes! that was exactly the problem. Nice to see it was such a simple solution, and a real "duh" moment for me. Thanks so much. Scott

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://846041]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2015-07-08 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls