What happens when Windows runs out of handles?

I see have an application which is using 40,000 handles. Could this be causing my system to become sluggish and unresponsive? What number of handles can Windows have before it becomes unstable?


Microsoft's Mark Russinovich provides lots of these kinds of tests on his blog.

See Pushing the Limits of Windows: Handles


Yes, this could easily be causing your system to become sluggish and unresponsive. Is it a homegrown application or commercial?

  1. Homegrown : fix the handle leak. Is something forgetting to close a file or TCP connection?
  2. Commercial : open a bug report and get that fixed.

For either, in the meantime, how long does it take for that many open handles to build up? Try restarting the process on an interval that won't affect your production environment, if you can.