I was working with 128 SSL connections at the time.

On Solaris, the memory size when it stopped growing was bigger than AIX.
However, on Solaris, the memory stopped growing after about 2 or 3 iterations of stopping and starting the SSL connections (maybe within half an hour).

-David

--------------------------------------------------
From: "Mike Brennan" <psu...@pittstate.edu>
Sent: Thursday, February 25, 2010 11:53 AM
To: <openssl-users@openssl.org>
Subject: Another "memory growing" on AIX


Greetings:

I ran across David's thread "memory growing when using SSL connections"
in last month's archive:

  http://marc.info/?l=openssl-users&m=126288242608221&w=2

My own experience is quite similar.  My application essentially
makes connections to a "database server" over https.  Only
one connection is active in the process at any moment, but it
potentially retrieves thousands of database records, one record
per connection.

The application gets its own memory usage at various points by
calling getrusage() and that's where all my observations about memory
size and allocation come from.

The process's memory footprint increases linerally with connections,
and this linear growth is quite constant.  As David reports, memory seems
to be allocated in multiples of 4K, but the linear memory growth is
around 136 bytes per connection.  I've confirmed this up to 24,000
connections.

Based on rusage(), every increase in process memory size occurs
after calling SSL_connect(), but before SSL_connect() returns.

Only a single SSL_CTX is created and is used for all connections.
I've freed objects as best as I know how, eg. X509_free(), SSL_free().
Session caching is turned off:

   SSL_CTX_set_session_cache_mode(our_ctx, SSL_SESS_CACHE_OFF);

This is on AIX 5.3.  Upgrading from openssl-0.9.8h to openssl-0.9.8l
didn't change anything.

David's suggestion that this may be an AIX-specific problem is
interesting, but I've got other non-ssl apps that run continually for
months, constantly allocating and freeing memory, and they don't
get very large.

David concluded the thread by reporting
(http://marc.info/?l=openssl-users&m=126411839411028&w=2) that the
process stopped growing after 5 days.  I'd be more interested in
knowing how many connections than how many days.

David apparently gave up on resolving this, and I probably will too.
But it sure would be nice to find a fix.

-Mike
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager majord...@openssl.org

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to