java.net.SocketException: Too many open files
Aditya
aditya at grot.org
Wed Mar 17 09:38:02 PST 2004
Hi Nick,
> On Tue, 16 Mar 2004 23:01:41 -0300, "Nick Gieczewski" <spam at msn2go.com> said:
> My FreeBSD 4.8-STABLE server is running a Java server application
> that has recently had an increase in concurrent users. The JDK is
> jdk-1.4.2p5. Since the user surge, the main thread has been dying
> repeatedly during peak hours at ServerSocket.accept() with the
> following message:
> Exception in thread "main" java.net.SocketException: Too many open
> files at java.net.PlainSocketImpl.socketAccept(Native Method)
> Now, here comes the weird stuff: My system is _not_ running out of
> file descriptors when this happens (kern.maxfiles = 16384,
> kern.openfiles = ~630), _nor_ is the per-process file descriptor
> limit being reached (it's set to unlimited). The heap is not full,
> either; its maximum size is set to 128 MB and it's under 60 MB when
> the thread dies. And there's plenty of both physical and virtual
> memory left.
I complained about something similar in the diablo 1.3 JDK package in
a message about a week ago and got no replies:
http://lists.freebsd.org/pipermail/freebsd-java/2004-March/001810.html
the crux of the problem seems to be that there is a max file
descriptor setting within the JVM that is set to be very low in the
FreeBSD native JVMs but interestingly enough, not in the linux ones
which I can run under emulation in FreeBSD.
This might not be the particular bug in question, but the test program
does give similar results:
http://developer.java.sun.com/developer/bugParade/bugs/4189011.html
I'd be interested in finding out a solution to this before 1.5 as that
bug suggests.
Thanks,
Adi
More information about the freebsd-java
mailing list