Closed non-blocking SocketChannel never cleaned up. File Descriptor leak
843790Jan 18 2008 — edited Oct 27 2008I have a small Java program using non-blocking ChannelSocket and it leaks File descriptors (Sockets never closed) as described in bug 6215050
I have tested on the following:
Linux RHEL 4 2.6.9-5.EL Sun JDK 1.5.0_11
Linux RHEL 4 Sun JDK 1.6.0_04
Linux RHEL 4 Bea JRockit 1.6.0_02
Ubuntu Linux 7.10 server 2.6.22-14 Bea JRockit 1.6.0_02
all with the same result.
I have tested a great number of suggested work arounds without success.
The socketChannel.socket().setKeepAlive(true); seems to make the number of "pipe" file descriptors less, but the problem remains and eventually the process stops.
Is this a Linux problem or Java problem?