Java Handle Leaks

Posted by: wfaulk

Java Handle Leaks - 26/10/2005 21:43

Azureus slows down my Windows machine. Way down. Other people seem to have similar complaints. I think I've found the cause. Despite limiting my peers to 150, there are 9740 open \Device\Afd\Endpoint handles. They seem to be handles for network connections. So it seems that either Azureus or Java itself is leaking handles. I thought I'd first ask our resident Java experts if they know of any such leak within Java before I go delving into Azureus code.

Anyone know anything?
Posted by: mcomb

Re: Java Handle Leaks - 26/10/2005 23:56

Quote:
\Device\Afd\Endpoint

I'm not even going to pretend to know what that is, but is it possible that some of these connections are in a FIN_WAIT/TIME_WAIT state? Due to the nature of bittorrent I would expect a lot of connections coming and going even if you've limited the number of actual accepted connections.

-Mike
Posted by: wfaulk

Re: Java Handle Leaks - 27/10/2005 02:06

Yeah, but ten thousand?
Posted by: andy

Re: Java Handle Leaks - 27/10/2005 10:23

Quote:

Anyone know anything?


I know that it doesn't effect all installs of Azureus. I use it 24/7 with dozens of torrents and have never seen any slow down (not the latest versions anyway, some of the early ones could get a bit chuggy).
Posted by: wfaulk

Re: Java Handle Leaks - 27/10/2005 14:54

Can you do me a favor and run Process Explorer against it and see if the Java process has a whole load of handles? Maybe your OS install, for some reason, handles having that many open better than mine.
Posted by: andy

Re: Java Handle Leaks - 27/10/2005 16:24

It does indeed have over 40,000 of those handles open. Clearly a leak of some sort.

As I say I don't have any performance problems with Azureus. This is on WinXP Pro, 2GB of RAM and a P4 2.8Ghz (with HyperThreading enabled).

Azureus is running under Java jre1.5.0_04 on my machine.
Posted by: schofiel

Re: Java Handle Leaks - 27/10/2005 21:08

What I would suggest is a NETSTAT /A from a CMD command line to observe the state of any socket connects that might be open.
Posted by: andy

Re: Java Handle Leaks - 28/10/2005 06:35

Quote:
What I would suggest is a NETSTAT /A from a CMD command line to observe the state of any socket connects that might be open.


Mine shows a few dozen BT connections as established, certainly not the 40,000 that Process Explorer shows.