I understand that the answer to this question may depend on registry settings and on the version of Windows, and perhaps on the amount of RAM if there is not enough memory. For the sake of this question, assume that the server has plenty of RAM (3+ GiB).
If an application (3rd party application in this case) leaks handles at a few hundred an hour, how many total handles can that application leak before other applications will run into troubles? By "troubles" I mean, for example, fail to start a thread, fail to open a file, and so on.
I've seen some servers (lightly loaded) run just fine with a process (usually a database process) using a few tens of thousands of handles, so the old 10000 handle limit is clearly not the issue here. (And that was a per-process limit anyway, so wouldn't affect my application which is well under that point.)
Can someone either answer the question or point me at some resources that explain about how many total handles a Windows server will allow before you effectively run out (of handles or other system resources)?
In one of the rare cases where Windows sets a hard-coded upper limit on a resource, the Executive defines 16,777,216 (16*1024*1024) as the maximum number of handles a process can allocate.
2,000 threads and 60,000 handles would be considered pretty normal for Windows 10.
If your program runs haywire, you will find that it manages to create about 10,000 window manager objects and then the system won't let it have any more.
The handle count you see in Task Manager is "the number of object handles in the process's object table". In effect, this is the sum of all handles that this process has open.
See Raymond Chen's post on this topic. The window manager enforces a limit of 10K per process, and has a total limit of 32K across the system. So if it "only" leaks 100 handles per hour, then you have a few days of uptime before it starts misbehaving.
Note that not all handles are equal. Window handles are not DB handles, for example, and may follow different rules. So this restriction might not apply, depending on what sort of handles the program is leaking. Also read this blog post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With