spx2 has asked for the wisdom of the Perl Monks concerning the following question:
I'm running a script that uses HTML::TreeBuilder and WWW::Mechanize and Mail::Send.
Its purpose is to scan some html and send some notifications to an email.
Now,because it's supposed to run uninterrupted and well over large periods of time without any problems there aren't supposed to be any memory leaks.
Inspite of this,after 1-2 days of running in background on a server it used all the memory on that server,and there was allot of memory on that server(12GB ram) and it also selfishly grabbed all the CPU cycles also(3 CPUs at 1ghz each , each dual-core).
So,this is very unusual for me,it never happened before,this problem happened with perl 5.10.0 I've been looking around some mailing lists and also perlmonks and I think someone else also mentioned that the garbage collection mechanism that perl uses may have some problems(I've found some evidence of people complaining they run scripts and when the scripts exit,they do not release the memory they acquired back to the operating system,that is not very good,altough this doesn't happen to me,the script just hogs memory over here and it releases when it exits).
I would like to add that I have tried to avoid any memory leaks myself or over-consumption by destroying the HTML::TreeBuilder object that I was using.
The only solution that I see know of would be to make a cron job that would close the script after 4-5 hours and restart it back again so that the memory will be realeased.
Questions: Why do you think this is happening ?
Does perl5/perl6 feature any possibility of forcing garbage collection after the programmer knows one variable is not needed any more ?
Best regards,
Stefan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Gargantuan memory consumption issues
by Corion (Patriarch) on Dec 22, 2008 at 23:12 UTC | |
by runrig (Abbot) on Dec 22, 2008 at 23:53 UTC | |
by spx2 (Deacon) on Dec 23, 2008 at 02:49 UTC | |
by p2409 (Initiate) on Dec 23, 2008 at 07:04 UTC | |
|
Re: Gargantuan memory consumption issues
by tilly (Archbishop) on Dec 22, 2008 at 23:00 UTC | |
by Jenda (Abbot) on Dec 22, 2008 at 23:32 UTC | |
by tilly (Archbishop) on Dec 22, 2008 at 23:48 UTC | |
|
Re: Gargantuan memory consumption issues
by Tanktalus (Canon) on Dec 22, 2008 at 23:50 UTC | |
|
Re: Gargantuan memory consumption issues
by ysth (Canon) on Dec 22, 2008 at 23:39 UTC | |
|
Re: Gargantuan memory consumption issues
by bruno (Friar) on Dec 23, 2008 at 16:41 UTC |