You have to treat threads like objects, and reuse them if you want to reuse their memory. Detaching does not mean they are a separate process. What you could do, would be to create 5 threads, and NOT detach them, then run each thread 10 times, then join them. That way, your memory usage will increase to the size-of 5 threads, but will not increase on each thread run. Unless of course you do something different in a thread-run, like create a huge structure in memory.