Dirk Eibach wrote: > Hello, > > we have lots of tasks, semaphores and mutexes in our complex > application. Stopping and restarting seems to leak some resources, > because we get ENOMEM when a thread is created after restarting the > application, first time everything goes well. > > Probably we do something wrong, maybe somebody can tell us what. What skin do you use? Native? Only the POSIX skin currently does auto-cleanup, the others require explicit care. > > What do we have to do in order to clean up all resources properly, > especially if our application is ended by SIGKILL? Install a signal handler and do cleanup of all allocated objects (tasks get deleted when they terminate). Either keep track of your allocated resources in some list(s) or signal the owners (tasks) that they should terminate and cleanup their locally allocated resources. There are dozens of ways to do this, depending on your application design. But if you think that you are cleaning up correctly and still face leaks, try to derive a simple test that demonstrates the issue. Jan