Keep It Simple, Stupid | |
PerlMonks |
Multithreaded memory usageby bingohighway (Acolyte) |
on Apr 21, 2009 at 07:54 UTC ( [id://758897]=perlquestion: print w/replies, xml ) | Need Help?? |
bingohighway has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks, 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!
Back to
Seekers of Perl Wisdom
|
|