[stunnel-users] possible stunnel memory leak

Stefano Stabellini stefano.stabellini at eu.citrix.com
Tue Mar 25 16:40:06 CET 2008

Michał Trojnara wrote:
> Stefano Stabellini wrote:
>> I may have found a possible memory leak in stunnel
>> (version 4.15) when used with pthreads.
> Please test it with latest stunnel and the OpenSSL library.
> I'd rather expect the leak to be within the OpenSSL library.
> Stunnel is very conservative about its dynamic memory allocation.

The situation is different with stunnel 4.21, the peak is lower (about 
100M instead of 300M) but after closing all the connections the memory 
usage is still about 50M:

VmPeak:    97036 kB
VmSize:    92652 kB
VmLck:         0 kB
VmHWM:     51444 kB
VmRSS:     46992 kB
VmData:    89192 kB
VmStk:        88 kB
VmExe:        84 kB
VmLib:      3124 kB
VmPTE:       104 kB

in any case a big improvement, but probably there is still an issue 
I think that it has something to do with deallocating resources when a 
thread dies, but it is just a guess.

More information about the stunnel-users mailing list