Subject: | Sockets are not auto closed |
Date: | Mon, 11 Oct 2010 17:48:08 -0400 |
To: | bug-IO-Socket-SSL [...] rt.cpan.org |
From: | Casey Duquette <casey.duquette [...] gmail.com> |
IO::Socket::SSL does NOT close sockets that go out of scope. I have a
threaded mail server and sockets are continuously opened and I had a
terrible memory leak for the longest time. Until recently I assumed they
would close themselves because the sockets get created in the threads work
loop and when the loop goes to the next iteration it is then out of scope
and I have Scalar::Util and Weakref with Perl v5.12.1. I started to
explicitly close my opened sockets just before the next loop iteration the
memory usage stopped to increase. Can someone try to find out why or in what
case sockets don't get automatically closed even if Scalar::Util and Weakref
are installed?
All my data troubleshooting history of this issue can be found here:
http://stackoverflow.com/questions/3252045/perl-threads-slowly-consume-memory