Subj : Re: Linux Posix Threads: Memory consumption To : comp.programming.threads From : Oliver Battenfeld Date : Thu Mar 31 2005 04:21 pm saraneus@web.de wrote: Hi, > That amount of memory stays [...] > Is this a normal effect? yes. > Do I have to take care of something special? You mean aside from reading the manpages? I quote from 'man pthread_join': When a joinable thread terminates, its memory resources (thread descriptor and stack) are not deallocated until another thread performs pthread_join on it. Therefore, pthread_join must be called once for each joinable thread created to avoid memory leaks. The alternative is setting the thread's 'detachstate' to 'detached' instead of 'joinable', which is the default. That can be done either upon thread creation by using the attribute parameter or in the thread routine itself using pthread_attr_setdetachstate. -- Bye, Oliver .