[PerlChina] perl的内存管理问题。

rorot yang.liana at gmail.com
Wed Mar 5 19:49:14 PST 2008


谢谢以上诸位。

如Tiger peng所说,我暂时这么解决,每隔1000个pages作为一个Process来处理。然后退出,再启动一个新的Process,如此循环。

PS. 我的HTML::DOM是最新版本。0.010 (Alpha).

rorot

2008/3/6 tiger peng <tigerpeng2001 at yahoo.com>:

> 1, Check if your HTML::DOM version. Should it be updated?
> 2, Sample workaround: Do not 解析 too many pages in one process: stop and
> restart the process for every 1 ~ n pages.
>
> ----- Original Message ----
> From: rorot <yang.liana at gmail.com>
> To: China-pm at pm.org
> Sent: Friday, February 29, 2008 8:10:32 PM
> Subject: [PerlChina] perl的内存管理问题。
>
> 大家好,
>
>     我用perl的HTML::DOM
> 解析约7万个HTML页面内容。结果发现没解析2,000个左右,脚本程序就出现一次崩溃。错误信息为内存占用过多,被操作系统杀死。
>
>     我不知道如何去DEBUG一个perl脚本,跟踪到底那部分没有释放内存。但是可以肯定的是我的程序是运行一个sub
> foo()循环,这个sub里的new
> Object()都被我调用过object->close(),也就是文档里说的destroy操作。为什么持续运行程序,内存暴涨,从10M一直上升到580MB然后被操作系统杀死。。。
>
>     能告诉我如何去调试一个perl程序, 或者直接找出那里出现内存泄露吗? 或者还是perl的内存管理释放内存的时间太慢???
>
> rorot
> Mar/01/2008
>
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm
>
>
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/china-pm/attachments/20080306/4e603f19/attachment.html 


More information about the China-pm mailing list