Subject: | Yet another memory leak |
IO::Socket::SSL is still leaking the memory even if one take care about #120643 by setting SSL_ocsp_mode => SSL_OCSP_NO_STAPLE
If I run the script that creates and closes SSL socket and watches for memory used by it, it will show constant growth of memory used
The script I used is
use strict;
use Memory::Usage;
use IO::Socket::SSL;
my $mu = Memory::Usage->new();
foreach my $i(1..100)
{
print $i,"\n";
$mu->record($i);
foreach (1..100)
{
my $cl = IO::Socket::SSL->new(PeerAddr=>'en.wikipedia.org:443' ,SSL_ocsp_mode => SSL_OCSP_NO_STAPLE);
$cl->close;
sleep 1; # Be polite, do not DDOS wikipedia
}
}
$mu->dump();
The output it gives is like
time vsz ( diff) rss ( diff) shared ( diff) code ( diff) data ( diff)
0 16064 ( 16064) 11320 ( 11320) 6188 ( 6188) 2280 ( 2280) 5400 ( 5400) 1
118 17972 ( 1908) 14296 ( 2976) 7356 ( 1168) 2280 ( 0) 7172 ( 1772) 2
237 18236 ( 264) 14620 ( 324) 7420 ( 64) 2280 ( 0) 7436 ( 264) 3
355 18632 ( 396) 14884 ( 264) 7420 ( 0) 2280 ( 0) 7832 ( 396) 4
473 18896 ( 264) 15148 ( 264) 7420 ( 0) 2280 ( 0) 8096 ( 264) 5
591 19160 ( 264) 15412 ( 264) 7420 ( 0) 2280 ( 0) 8360 ( 264) 6
709 19424 ( 264) 15940 ( 528) 7420 ( 0) 2280 ( 0) 8624 ( 264) 7
827 19820 ( 396) 16204 ( 264) 7420 ( 0) 2280 ( 0) 9020 ( 396) 8
945 20084 ( 264) 16468 ( 264) 7420 ( 0) 2280 ( 0) 9284 ( 264) 9
1063 20348 ( 264) 16732 ( 264) 7420 ( 0) 2280 ( 0) 9548 ( 264) 10
You see, data and vsz constantly growing... The rate is less than in #120643 but it is still here...
I tied it on current Debian Sid with perl 5.26.1, IO::Socket::SSL 2.052 and Net::SSLeay 1.80