Event handle leak in an idle .NET Framework 4 application


Symptoms


Certain Microsoft .NET Framework 4 applications leak event handles even when the application is idle.

Cause


Microsoft has confirmed that this is a bug in the .NET Framework 4. The issue occurs because the thread pool is creating and destroying threads, but it will not actually reclaim the memory and handles associated with a thread until the garbage collector runs. For some applications, this happens very rarely, because they seldom allocate managed objects.

Resolution


This issue has been fixed in the Microsoft .NET Framework 4.5.