On Fri, Aug 08, 2003 at 12:43:16AM +0100, John J Lee wrote:
> On Thu, 7 Aug 2003, [EMAIL PROTECTED] wrote:
>
> > Having a potential TreeBuilder memory problem when using it to parse
> > through a large HTML table (> 2K rows) where the memory allocation grows to
> > about 20M on my server and never goes down even after finishing with the
> > HTML and TreeBuilder structures. The Perl script runs as a CGI and Apache
> > gives up after awhile with the following line in the error logs - "Out of
> > Memory !!"
> [...]
>
> 20 Mb does seem a lot, but why would one expect the process memory usage
> to fall after parsing is comlpete? On most systems, memory used by a
> process and free'd isn't returned to the system until the process exits.
>
> Sorry, no actual help...
Look at the DESCRIPTION section of the HTML::TreeBuilder perldoc, item 4:
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.
It may explain the problem.
-
Reinier