help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gnutls] Re: memory leak in gnutls in multithreaded program??


From: Simon Josefsson
Subject: [Help-gnutls] Re: memory leak in gnutls in multithreaded program??
Date: Fri, 10 Feb 2006 16:04:24 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Ang Way Chuang <address@hidden> writes:

> Hi all,
>    I wrote a sample server program using gnutls 1.2.9. I did gcry_control
> (GCRYCTL_SET_THREAD_CBS ...) stuff mentioned in the manual. Yet whenever I
> create a new thread to service a new session from client, the memory 
> allocation
> for the server process increases for every new thread created. I saw this
> behaviour through top.However, when the thread exits, the memory wasn't freed.
> I run the program under valgrind and there is no memory leak reported. Do I
> need to do anything special in the thread apart from gnutls_bye, shutdown,
> close & gnutls_deinit to get the memory freed? Please advise. Thanks

Hi.  You'll need to deallocate all other stuff that may have been
allocated in that particular thread (like certificates), of course,
but other than that.

If valgrind doesn't indicate a memory leak, I would guess that the
threading sub-system simply steals that memory from you.

Sorry that this is little help.  Perhaps others have more ideas.

Regards,
Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]