Dr H. If you get a chance could you look at this. Thanks Bharath,
I gave it a try and it didn't make any difference, although it certainly didn't hurt. It was worth a shot. The memory leak seems to happen every 3 or 4 connections/transfers. It increases by 4K or 8K and never releases the memory back. For 2 or 3 connections/transfers there is no indication of a leak, then on the 3rd or 4th transfer memory will jump usually by 4K, sometimes by 8K. I'm trying to find a pattern, but so far, no luck. Remember, I am making/breaking connection and sending a packet of approximately 360 bytes, once each second (or so). Am I cycling too fast for SSL to release resources maybe? Pulling out hair on this one, Scott -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of T Bharath Sent: Friday, December 28, 2001 1:46 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Memory Leak?? I can't find it. Make sure to call ERR_remove_state(0); in all threads after the transfer ERR_remove_state() frees the error queue associated with thread pid. If pid == 0, the current thread will have its error queue removed. Since error queue data structures are allocated automatically for new threads, they must be freed when threads are terminated in order to avoid memory leaks. Regards Bharath ----- Original Message ----- From: "Scott Frazor" <[EMAIL PROTECTED]> Date: Thursday, December 27, 2001 1:58 pm Subject: Memory Leak?? I can't find it. > Any input would be most helpful. I'm new at this and not sure > I'm doing > everything in order or everything that is necessary. > > I have written a client that processes data at about 1 packet per > second.The requirements are that I create a new SSL connection and > socketconnection for each transaction and then close the SSL > connection and close > the socket. > > As I process the transactions I notice that I use up approximately > 8K and it > is never released back to the application. Before long the system > runs out > of resources/memory. > > Here are the calls I am making to open the socket, SSL and wirte > and read > data, shut them down and free them. Everything runs fine except > the leak. > > > SSL_METHOD:= SSLv3_client_method(); > SSLeay_add_ssl_algorithms() > SSL_CTX:=SSL_CTX_new(SSL_METHOD) > SSL_CTX_set_cipher_list(SSL_CTX,'ALL') > SSL_CTX_set_options(SSL_CTX,SSL_OP_ALL) > SSL_CTX_set_info_callback(SSL_CTX, @ssl_InfoCallback); > SSL_CONNECTION:=SSL_new(SSL_CTX); > SSL_clear(SSL_CONNECTION); > SSL_BIO:= f_BIO_new_socket(sd,BIO_NOCLOSE); > SSL_set_bio(SSL_CONNECTION,SSL_BIO,SSL_BIO); > SSL_set_connect_state(SSL_CONNECTION); > SSL_connect(SSL_CONNECTION) > 0 then ...... > SSL_do_handshake(SSL_CONNECTION); > SSL_get_error(SSL_CONNECTION,i); > ........ > SSL_write > ......... > SSL_read > ......... > ssl_shutdown(SSL_CONNECTION); > if SSL_CONNECTION <> nil then ssl_free(SSL_CONNECTION); > > err:=winsock.closesocket(sd); > > if err=WSAEWOULDBLOCK then > winsock.closesocket(sd); > > Thanks for looking this over, > Scott > > > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List [EMAIL PROTECTED] > Automated List Manager [EMAIL PROTECTED] > ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]