[question] Experience With Handle Leaks

I recently completed an app that leaked about 1 socket handle per second.

Don't ask me why. This has been fixed anyway.

Running under 2000, I actually didn't expect the app to kill all internet and network

activity within half an hour. Some apps misreported the resource bottleneck as the

network driver being unable to load. Since these were raw ICMP sockets, they

wouldn't bind to a specific port and cause the system to run out of ports as TCP or

UDP sockets would do.

On the other hand I know that 95/98/ME had an overall limit of 65536 Handles,

while NT based 32-bit systems support 2 Billions of them - for each process.

How could the above contradiction be solved? Just curious.

#203648

Programmers do have their own language. :wacko:

#203860

Windows 2000 does have a hardcoded limit of 10,000 handles per process, basically to make sure programmers won't be lazy with handles :P Seriously, I remember some MS KB article that stated this.

#203904

Even with a single process exceeding its limit, it shouldn't kill all network

activity of all other processes; MSN shouldn't drop dead (OK, it always does),

Internet Explorer shouldn't complain on a DNS lookup failure, Explorer shouldn't

drop mounted network shares and ipconfig.exe shouldn't produce a blank list to

name a few.

Maybe this has happened elsewhere and I accidentally found an explanation

to the issue, that's why I'm asking.

#203927

I can't remember quite where, but I seem to have the funniest feeling that there's something, somewhere, in Windows' handling of ICMP/UDP/TCP (and various other protocols), there's a limit (that's not resource based) that's imposed on processes for "security" reasons...

Basically, the theory goes something like "unless it's part of the OS, it's not going to be making many raw packet communications", and so there's this limit imposed, such that malicious coders can't create massive network protocol stack overruns...

I also seem to recall this limit being lowered in XP SP2 (or maybe I'm just getting confused, 'cos it's late).

Sorry I couldn't be more help, but I hope this give some sort of indication of what might be happening (assuming I'm right) :unsure:

#205389

Originally posted by herd@Aug 18 2004, 02:15 PM

Even with a single process exceeding its limit, it shouldn't kill all network

activity of all other processes; MSN shouldn't drop dead (OK, it always does),

Internet Explorer shouldn't complain on a DNS lookup failure, Explorer shouldn't

drop mounted network shares and ipconfig.exe shouldn't produce a blank list to

name a few.

Maybe this has happened elsewhere and I accidentally found an explanation

to the issue, that's why I'm asking.

<{POST_SNAPBACK}>

100% right :)

#209386