in reply to Re^3: problems with fork from thread
in thread problems with fork from thread

Like I said, I'm forking in order to not accumulate the memory leaks in the main program. Forking will increase the memory size of the new process only and get rid of it when it dies.

I have $tree = $tree->delete() and also undef ($tree). Also I put everything in a class and undefed the class, but I still see the memory increasing.

Replies are listed 'Best First'.
Re^5: problems with fork from thread
by Gangabass (Vicar) on Mar 04, 2012 at 02:49 UTC
    Also I have moved use HTML::TreeBuilder::XPath; to the thread (with require) and this help me...
      I still see memory leaks. And I left only:
      my $tree = HTML::TreeBuilder->new(api_version => 3);
      $tree = $tree->parse_content(decode_utf8($html));
      $tree = $tree->delete();

      If I return before parse_content, everything is fine.