From owner-freebsd-java Sat Nov 9 9:29:51 2002 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 5EEA037B401 for ; Sat, 9 Nov 2002 09:29:50 -0800 (PST) Received: from mighty.grot.org (mighty.grot.org [66.117.128.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10BF443E3B for ; Sat, 9 Nov 2002 09:29:50 -0800 (PST) (envelope-from aditya@grot.org) Received: by mighty.grot.org (Postfix, from userid 515) id B54B15DAF; Fri, 8 Nov 2002 11:59:14 -0800 (PST) Date: Fri, 8 Nov 2002 11:59:14 -0800 From: Aditya To: Cedric Berger Cc: freebsd-java@FreeBSD.ORG Subject: Re: preventing the JVM from swapping to disk Message-ID: <20021108195914.GA5859@mighty.grot.org> References: <20021107023304.GA75921@mighty.grot.org> <3DCA37D5.6010305@wireless-networks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DCA37D5.6010305@wireless-networks.com> Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, Nov 07, 2002 at 10:52:21AM +0100, Cedric Berger wrote: > >On a server solely dedicated to running Tomcat with the linux-jdk1.3 and > >1Gig > >of RAM I'd like to prevent the JVM from ever swapping to disk. The > >preferred > >behaviour when it runs out of memory is for the JVM to exit (it will be > >restarted by a script). I'm allocating the JVM 700M for the min and max > >heap; > >less than 100M is used by FreeBSD and the rest is occupied by the JVM. > > > I don't understand your question. > Why would it swap if: > 1) You've 1GB of RAM > 2) You limit the JVM to 700M. (you can use "ulimit" to enforce that) it's not the JVM that I was limiting but rather the heap the JVM allocates to Tomcat internally. But yes, using ulimit to limit the size of the JVM is a good idea and one I should have thought of, thanks ;-) The JVM, despite the internal heap size limit, does tend to grow quite a bit hence the running out of memory situation. Thanks, Adi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message