How to trace handle leaks? How to trace handle leaks? windows windows

How to trace handle leaks?


I suggest using Process Explorer. Run it as Administrator to make sure you see all the relevant data. There you can observe what kind of handles your process has and which are excessively being created and not free'd. This should help you to narrow down the search (in my case, i had sockets leaking all over the place due to some false assumptions about the behaviour of winsocks.). Perhaps then you can isolate the relevant code and post it here for us to check if there is anything wrong. Good luck!


Some profilers (i.e. AQTime) can profile Windows resource applications. If you're using XE, you have a basic version of AQTime available.

Handle leaks are common if an execution path doesn't close them properly - but a in Windows a handle is a very common item used in very many different situations, which kind of handles is your application leaking?