Closed olegwtf closed 4 years ago
This may be a fix
@@ -2076,8 +2076,7 @@
if (my $ssl = ${*$self}{_SSL_object}) {
delete $SSL_OBJECT{$ssl};
if (!$use_threads or delete $CREATED_IN_THIS_THREAD{$ssl}) {
- $self->close(_SSL_in_DESTROY => 1, SSL_no_shutdown => 1)
- if ${*$self}{'_SSL_opened'};
+ $self->close(_SSL_in_DESTROY => 1, SSL_no_shutdown => 1);
}
}
delete @{*$self}{@all_my_keys};
Thank you for your bug report and proposed fix. It should be fixed in 8bc7d93 based on your idea.
Looks fixed. Thanks. Waiting on cpan.
The changes are in the just released version 2.067. Thanks again for your help.
This was originally found in Mojolicious: https://github.com/mojolicious/mojo/issues/1469 But then I tracked this down to IO::Socket::SSL. If we'll destroy object for which server didn't respond with initial handshake this will produce memory leak. I can reproduce this with such server:
and such client:
Memory usage of this client script grows without a stop, however I can see that
IO::Socket::SSL::DESTROY
called and size of script variables is constant.