bingohighway has asked for the wisdom of the Perl Monks concerning the following question:
I am currently writing a program that pulls some info off a web page, processes it, then whacks it into a database. It has to be fairly punctual and run every 5 seconds. As this process can sometimes take a few seconds, sometimes more than 5, I have decided to set each 5 second read as a new thread.
I am currently experiencing a problem of once a thread has finished it isn't releasing the memory, and the memory usage gradually increases as more threads are created. I have tried detaching the thread with a return() at the end of it, no joy. Exit() just kills the parent process. I have also tried waiting for say 20 seconds and killing the thread externally, e.g. $thread->exit().
I am currently using the threads module.
Any ideas?
Cheers!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multithreaded memory usage
by moritz (Cardinal) on Apr 21, 2009 at 08:01 UTC | |
by bingohighway (Acolyte) on Apr 21, 2009 at 08:04 UTC | |
by moritz (Cardinal) on Apr 21, 2009 at 08:26 UTC | |
by bingohighway (Acolyte) on Apr 21, 2009 at 08:31 UTC | |
by moritz (Cardinal) on Apr 21, 2009 at 09:09 UTC | |
| |
by why_bird (Pilgrim) on Apr 21, 2009 at 09:45 UTC | |
by moritz (Cardinal) on Apr 21, 2009 at 10:47 UTC | |
by bingohighway (Acolyte) on Apr 21, 2009 at 13:25 UTC | |
by Corion (Patriarch) on Apr 21, 2009 at 14:06 UTC | |
by moritz (Cardinal) on Apr 21, 2009 at 13:51 UTC | |
by bingohighway (Acolyte) on Apr 21, 2009 at 14:02 UTC | |
by moritz (Cardinal) on Apr 21, 2009 at 14:05 UTC | |
|
Re: Multithreaded memory usage
by BrowserUk (Patriarch) on Apr 21, 2009 at 15:48 UTC | |
by bingohighway (Acolyte) on Apr 21, 2009 at 20:20 UTC | |
|
Re: Multithreaded memory usage
by ikegami (Patriarch) on Apr 21, 2009 at 14:03 UTC |