From owner-freebsd-java@FreeBSD.ORG Fri May 26 17:07:33 2006 Return-Path: X-Original-To: freebsd-java@freebsd.org 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 9B76716A82D for ; Fri, 26 May 2006 17:07:33 +0000 (UTC) (envelope-from kurt@intricatesoftware.com) Received: from mta2.srv.hcvlny.cv.net (mta2.srv.hcvlny.cv.net [167.206.4.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15B8D43D66 for ; Fri, 26 May 2006 17:07:30 +0000 (GMT) (envelope-from kurt@intricatesoftware.com) Received: from [172.16.1.72] (ool-457a77e8.dyn.optonline.net [69.122.119.232]) by mta2.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTP id <0IZV0078WU7VMN10@mta2.srv.hcvlny.cv.net> for freebsd-java@freebsd.org; Fri, 26 May 2006 13:07:12 -0400 (EDT) Date: Fri, 26 May 2006 13:07:06 -0400 From: Kurt Miller In-reply-to: To: freebsd-java@freebsd.org Message-id: <200605261307.06671.kurt@intricatesoftware.com> MIME-version: 1.0 Content-type: text/plain; charset=koi8-r Content-transfer-encoding: 7BIT Content-disposition: inline References: <200605260932.19449.kurt@intricatesoftware.com> User-Agent: KMail/1.9.1 Cc: Vadim Goncharov Subject: Re: diablo 1.5 died after 5 day uptime X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 May 2006 17:07:34 -0000 On Friday 26 May 2006 11:39 am, Vadim Goncharov wrote: > 26.05.06 @ 20:32 Kurt Miller wrote: > > >> >> I have an SMP (HTT) machine with 5.5-PRERELEASE, using official >> > >> diablo 1.5 jdk > >> >> binaries from beginning of April. As suggested, I now run java with > >> >> -XX:+UseMembar cmdline switch, that resolved problem with crashing > >> >> application after startup. > >> >> But today after 5 days uptime now-debugged-and-set-to-long-run server > >> >> process > >> >> have crashed, with 100M coredump file. What happened? Below are log > >> and > >> >> gdb backtrace. > >> >> As some additional info: I have limits in login.conf, 32M for > >> resident > >> >> size > >> >> and 256M for virtual mem size; yesterday when I looked at process > >> stats > >> >> it was about 10M resident and 250M virtual - could be a reason?.. > >> > > >> > Hi, > >> > > >> > It does appear that you've run out of vm. > >> > > >> > > >> >> #21 0x0a3fceda in vm_exit_out_of_memory () > >> >> from /usr/local/diablo-jdk1.5.0/jre/lib/i386/client/libjvm.so > >> > >> But so why it dies on signal 11 with scary logs and coredump, instead of > >> descriptive out-of-memory diagnostics and graceful shutdown? Isn't that > >> a bug ? > > > >> From what I can gather from the stack trace, the jvm was > > in the process of a graceful shutdown but there wasn't enough > > memory for it to pull it off. There is only so much you can > > do to protect against out-of-memory errors when you need more > > to report it nicely to the user. > > Hmm, OK. Is there any way to tell Java that memory is about to end > before killing ? Or may be a way to make GC to free some memory > periodically? May be outside from java, undocumeted external > signaling to diablo-jdk ? At last, does it respect login.conf limits > at all, doing graceful shutdown before / trying to raise to hard limit ? > If your goal is to limit the amount of memory the jvm uses, I would recommend using the standard command line arguments that control the heap size (-Xmx & -Xms) and leave your limits high. Note that the jvm uses more memory then is controlled by the -Xmx arg. You need to leave some head room for that if your going to be setting your limits lower. -Kurt