Subj : pthread_create and memory To : comp.programming.threads From : Giorgio Spinazzola Date : Fri Mar 11 2005 10:09 am Hi, I hava fedora core 2 linux system with kernel 2.6.5-1.358 and i have installated the pthread library. I try to use the function pthread_create (). I done this simplex test:and work fine. The only problem is that after each new thread the memory of my process in increased of 10 MB !!! Why ?? Can you hel me please void *thread_func (void* p) { while (1) { printf ("ciao\n"); sleep(1); } return (NULL); } int testthread() { int i, numthreads; int retval; numthreads = 10; pthread_t thread_id[10]; for ( i = 0; i < numthreads; i++ ) { (void) printf( "Thread #%d: ", (i + 1) ); if ( ( retval = pthread_create( &thread_id[i], NULL, thread_func, NULL ) ) != 0 ) { (void) fprintf( stderr, "*** Unable to create thread #%d ***\n", i ); } (void) printf( "thread done\n" ); (void) sleep( 1 ); } return( EXIT_SUCCESS ); } The thread is created and work fine. The problem is that the memory of my process is increased from 3Mb to 13 MB .