______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
I'm looking into very high number of memory allocations in our app
using OpenSSL. We are doing a lot of SSL_write()s of small chunks of data
and each call to SSL_write seems to result in a malloc. We are getting
around 10 thousand CRYPTO_malloc() calls a second and I assume that this
is very expensive.
Looking at the source code I see that ssl3_mac() always calls
EVP_DigestInit_ex which does the allocation. No attempt to keep the
allocated EVP_MD_CTX structure is made. At this point I'm kind of stuck
because I don't understand what this EVP_MD_CTX is etc. Would appreciate
input from the OpensSSL people. Maybe I'm just not setting up the
library right? Or is there a Real Good Reason for reallocating this
struct every time? Of course it is possible that I overestimate the
performace impact of calling CRYPTO_malloc a lot?
Also I noticted that there is a flag EVP_MD_CTX_FLAG_REUSE but it seems
to be used only by ssl3_handshake_mac and not by the ssl3_mac.