Syntactic Confectionery Delight | |
PerlMonks |
Perl threads memory leak with socket and solutions I tried...by ilxl (Initiate) |
on Feb 10, 2010 at 01:35 UTC ( [id://822328]=perlquestion: print w/replies, xml ) | Need Help?? |
ilxl has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
This problem has been my headache for two weeks. Can anyone help me? Thanks a lot!
This program will create a thread for any socket client connection. But I found the memory is increasing rapidly, and the program will crash after have run for about 3 days. In the past weeks, I tried a lot of solutions for this problem: 1. I updated Perl from v5.8.8 to v5.10.1, and threads from v1.0.7 to v1.7.5 ----It didn't work. 2. I used Thread::Pool module to avoid massive threads open and close, which might have caused memory leak. ---It prompted error: Can't store GLOB items at lib/Storable.pm. That's because $conn above is GLOB value 3. I tried to transfer fileno($conn) between threads and re-construct socket client by open my $conn, "+<&=$fno"; ---It didn't work. fileno($conn) always returns 9 and socket client can't be re-opened. 4. I used some other threadpool module ---They didn't work for $conn cannot be shared. it's not a simple data structure. So after so many tries, I still cannot make it. Can any Monk help me? Thanks!
Back to
Seekers of Perl Wisdom
|
|