Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Mar 2004 12:37:59 -0500
From:      Aditya <aditya@grot.org>
To:        "Nick Gieczewski" <spam@msn2go.com>
Cc:        java@freebsd.org
Subject:   Re: java.net.SocketException: Too many open files
Message-ID:  <lor7vrnzm0.fsf@mighty.grot.org>
In-Reply-To: <011a01c40bc3$cd534050$0200a8c0@rescue> ("Nick Gieczewski"'s message of "Tue, 16 Mar 2004 23:01:41 -0300")
References:  <011a01c40bc3$cd534050$0200a8c0@rescue>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Nick,

> On Tue, 16 Mar 2004 23:01:41 -0300, "Nick Gieczewski" <spam@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?lor7vrnzm0.fsf>