简体   繁体   English

Perl LWP内存泄漏?

[英]Perl LWP memory leak?

I have a continuously running crawl (using Perl LWP) where I do extraction on crawled webpages using HTML::TreeBuilder. 我有一个连续运行的爬网(使用Perl LWP),在这里我使用HTML :: TreeBuilder对爬网的网页进行提取。 I assiduously delete every instance of HTML::TreeBuilder that I create, yet the memory footprint of the crawler rises slowly but steadily (I'm watching it tick up by 10 to 30 bytes with every page that is crawled (I'm using Valgrind to measure heap usage). 我刻苦地删除了我创建的每个HTML :: TreeBuilder实例,但搜寻器的内存占用量却缓慢而稳定地增加(我正在观察的每个页面都将其增加10到30个字节(我正在使用Valgrind衡量堆使用情况)。

Right now the flow is something like: 现在,流程类似于:

  • Crawl page 检索页面
  • Create new tree builder object 创建新的树构建器对象
  • Parse page 解析页面
  • Delete tree builder object 删除树构建器对象

Does anyone have hints about whether there's a memory leak in either LWP or TreeBuilder? 是否有人暗示LWP或TreeBuilder中是否存在内存泄漏? I've read a bunch of reports that LWP had memory leaks in it, but I haven't seen a response on that matter. 我读过很多关于LWP内存泄漏的报告,但是我还没有看到对此的回应。

I'm running Perl v5.10.1 我正在运行Perl v5.10.1

thanks! 谢谢!

I suppose that problem with HTML::TreeBuilder. 我想HTML :: TreeBuilder会出现这个问题。

Could you may to check following links: 您可以检查以下链接:

1) Stackoverflow memory leak in HTML::TreeBuilder 1) HTML :: TreeBuilder中的Stackoverflow内存泄漏

2) Perlmonks Memory Leak? 2) Perlmonks内存泄漏? i'm clueless. 我一无所知。

I hope these links will help you. 希望这些链接能对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM