Hi Jorge, I just got the chance to look at your little test program. It has a few bugs: 1) In pthread_create() you are passing a pointer to the unintialized thrdID[i] variable. Pthreads does not guarantee that the threadID argument is initialized before the start_routine is called. If you try printing the value of p_thrID in the 'thr_function', you'll see you'll get some correct and some random values. 2) Still, it's not a good idea to pass variables from the thread stack. In this particular case, it will work since the main thread outlives all the created ones, but it is usually highly likely to cause you headaches... A minimal fix for your test code is: --- pth_mem.orig.c 2004-11-25 11:16:01.000000000 -0500 +++ pth_mem.c 2004-11-25 11:33:34.000000000 -0500 @@ -7,11 +7,10 @@ int mode; static void *thr_function(void *data) { int i; - pthread_t *p_thrID = data; void *mem; if (mode == 'd') - pthread_detach(*p_thrID); + pthread_detach(pthread_self()); for (i = 0; i < 10; ++i) { mem = malloc(1024*1024); In my box, this gets rid of any leaks. best regards, -- Livio B. Soares