I have a native win 32 application that, during load testing as an HTTP server, causes the Working Set to increase over time. There are no memory leaks (confirmed by tracking Private Bytes in PerfMon and using FastMem to monitor memory usage during runtime). Note: the load is constant, with about 50 concurrent connections, so there is no significant variation.
Using Process Explorer, I've narrowed the problem down to Token handle leaks. I've also used madKernel to report on handle usage counts, which also confirms that token handles keep increasing.
To be precise, I'm seeing the following in Process Explorer:
All the token handles shown in Process Explorer have the same name: 'Doug-M46\Doug:ff739'):
There are no security (or other related API calls that require security credentials) that I can see in the code, but there must be something being called that causes this problem, I just don't know what else to look for.
I've used AQTime to try and track to source of the leak, but have not had any luck. At this point I'm considering hooking all the possible API calls that could cause this leak, so I can track it down, but I'd prefer to avoid such an extreme measure.
My application uses the ICS HTTP Server component in a separate thread to handle HTTP requests for my application (32-bit application, Delphi XE-2, ICS V8 Gold, Windows 7 Professional Build 7601: SP1).
Any insight into the cause of these handle leaks would be very much appreciated, as I've been trying to hunt them down for quite a while now.
References: