Clean up thread state on exit When a thread exits we don't fully clean up its state until process end. Effectively this leaks memory. Clean it up and test with a fork bomb application.