Skip Menu |

This queue is for tickets about the IO-Socket-SSL CPAN distribution.

Report information
The Basics
Id: 62058
Status: rejected
Priority: 0/
Queue: IO-Socket-SSL

People
Owner: Nobody in particular
Requestors: casey.duquette [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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
This simple program shows, that sockets get autoclosed, e.g. it shows that the number of file descriptors in use does not grow. If you are still think, that it's the fault of IO::Socket::SSL and not your program please provide a *simple* test program to demonstrate the issue. Regards, Steffen ---- use strict; use warnings; use IO::Socket::SSL; for(1..10) { my $cl = IO::Socket::SSL->new('www.google.com:443') or die $!; report_fn(); } report_fn(); sub report_fn { open( my $ps,'-|',"lsof -Ff -p$$ 2>/dev/null"); my @fd = grep { m{^f(\d+)} } <$ps>; warn int(@fd)." file descriptor in use\n"; };