On Wed, Nov 08, 2000 at 02:22:06PM +0530, Shridhar Bhat wrote:

> I have written a server which receives connections from
> SSL clients. I accept SSL connections as well as read the 
> data from the client in the following function: DoSSLRead. 
> Upon the arrival of the client connection, the SSL_read()
> is called 3 times (2 times for handshake data and once
> for client app data). When I monitor this process through
> top, I see that the process footprint increases by 8kb 
> each for first two calls of SSL_read. In the last SSL_read
> call, when I read app data, there is no leak. Thus, for
> every client connection, my process seems to leak 16kb.

Sure that those are memory _leaks_?  If the SSL objects are created
from the same SSL_CTX, then the SSL_CTX will contain a session cache,
which will expand as new sessions are added.

Memory allocated by OpenSSL (most of it, anyway) can be tracked
by enabling the built-in memory debug functions.  They are on
by default if the library has been compiled with CRYPTO_MDEBUG
or one of its variants, and can otherwise be enabled by calling
CRYPTO_malloc_debug_init().  Call CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
to actually start it (before this call, you can create a BIO
to which to print the list of unfreed memory blocks later);
see apps/openssl.c.  To output a readable list of memory blocks
currently allocated, call CRYPTO_mem_leaks(bio).


-- 
Bodo Möller <[EMAIL PROTECTED]>
PGP http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller/0x36d2c658.html
* TU Darmstadt, Theoretische Informatik, Alexanderstr. 10, D-64283 Darmstadt
* Tel. +49-6151-16-6628, Fax +49-6151-16-6036
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to