From owner-freebsd-java@FreeBSD.ORG Wed Mar 17 09:38:02 2004 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7877B16A4CE for ; Wed, 17 Mar 2004 09:38:02 -0800 (PST) Received: from mighty.grot.org (66-117-150-96.web.lmi.net [66.117.150.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5EBF43D39 for ; Wed, 17 Mar 2004 09:38:01 -0800 (PST) (envelope-from aditya@grot.org) Received: by mighty.grot.org (Postfix, from userid 515) id 74B845D5C; Wed, 17 Mar 2004 17:37:59 +0000 (GMT) To: "Nick Gieczewski" References: <011a01c40bc3$cd534050$0200a8c0@rescue> X-Archive: encrypt From: Aditya Date: Wed, 17 Mar 2004 12:37:59 -0500 In-Reply-To: <011a01c40bc3$cd534050$0200a8c0@rescue> ("Nick Gieczewski"'s message of "Tue, 16 Mar 2004 23:01:41 -0300") Message-ID: Lines: 40 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.4 (Common Lisp, i386--freebsd) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: java@freebsd.org Subject: Re: java.net.SocketException: Too many open files X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2004 17:38:02 -0000 Hi Nick, > On Tue, 16 Mar 2004 23:01:41 -0300, "Nick Gieczewski" 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