Share via


Colossal Handle Leak

So I was un-installing an application (which I won't name) and just happened to notice a rather large handle count in Task Manager. Now, most applications which leak handles will consume on the order of several thousand handles, but this program (which was a custom setup application) had opened hundreds of thousands of handles.

 

Handle Leak

Oops, that was a missed test case.

 

I took the screenshot just before heading off to a meeting, but since my curiosity was piqued, I turned on a memory tracking script and started to take a snapshot of the handle and memory usage every 5 minutes. After getting back into the office, I checked the log and saw that the setup app had maxed at 430,097 handles.

 

Stress and leak testing is an important task, even on "run once" (twice?) applications like a setup program. Also don't forget that there are other types of leaks than memory: any resource can be leaked.