From owner-freebsd-java@FreeBSD.ORG Thu Mar 17 16:18:33 2005 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 3751716A4CE for ; Thu, 17 Mar 2005 16:18:33 +0000 (GMT) Received: from srv04.bkmedia-hosting.com (srv04.bkmedia-hosting.com [69.57.140.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id B7C5E43D5D for ; Thu, 17 Mar 2005 16:18:32 +0000 (GMT) (envelope-from trash@nixsoftware.com) Received: from ash (host82.201-252-74.telecom.net.ar [201.252.74.82]) (authenticated (0 bits))j2HGHjq06903; Thu, 17 Mar 2005 17:17:45 +0100 Message-ID: <04bb01c52b0d$0ab3ec60$0200a8c0@ash> From: "Nicolas Gieczewski" To: References: <00e201c52907$41af13f0$0200a8c0@ash> <20050316163228.GA58595@misty.eyesbeyond.com> Date: Thu, 17 Mar 2005 13:19:00 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4946.1400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4946.1400 Subject: Re: jdk-1.4.2p7 crashes with no indication of why 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: Thu, 17 Mar 2005 16:18:33 -0000 > > A couple of days ago I moved a very thread-intensive Java = application > > from a server running Linux to a server running FreeBSD 5.3-RELEASE = and > > jdk-1.4.2p7. The server has an Athlon XP 2600+ processor and 512 MB > > of memory. > >=20 > > The application services around 700 concurrent clients during peak = hours > > and creates at least one thread for each connection, with many = connections > > requiring 2+ threads. The total number of threads during peak hours = is > > usually between 1600 and 2200. > >=20 > > The problem: During peak hours, the JVM dies several times an hour = with > > no indication of why. Nothing is written to stdout or stderr, = there's no log > > file, no core dump, and nothing in /var/log/messages. > >=20 > > Its very difficult to have any clues since there isn't much = information > to be had :(. >=20 > Try updating to 5.3-STABLE as another poster has suggested. If the > problem persists, try using java_g instaead of java and maybe run that > under gdb and see if you can get a trace. I upgraded to 5.4-PRERELEASE yesterday and the problem persists. I've noticed something that may be of interest, though: Until yesterday, I had been running the JVM with the -Xmx256m parameter. If I didn't, the JVM would run out of memory and threads would die with java.lang.OutOfMemoryError exceptions. This happened on Linux as well, and using -Xmx256m got rid of those errors. However, on FreeBSD, -Xmx256m appears to be the cause of my random, silent crashes: If I change it to, say, -Xmx128m, the JVM no longer crashes. But it does run out of memory because 128 MB is not enough, so that's not an acceptable solution. To summarize: -Xmx256m: Fine on Linux, random silent crashes on FreeBSD. -Xmx128m: java.lang.OutOfMemoryError exceptions on both OSs. Does this help at all? By now I'm pretty much sure that the crashes I'm experiencing are memory-management-related; otherwise they shouldn't go away when changing the value of -Xmx. Thanks, Nick