From owner-freebsd-current@FreeBSD.ORG Fri Jun 18 16:14:03 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B6E6416A4D4 for ; Fri, 18 Jun 2004 16:14:03 +0000 (GMT) Received: from mail005.syd.optusnet.com.au (mail005.syd.optusnet.com.au [211.29.132.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A4D243D39 for ; Fri, 18 Jun 2004 16:14:00 +0000 (GMT) (envelope-from akm@theinternet.com.au) Received: from theinternet.com.au (c211-30-103-113.carlnfd1.nsw.optusnet.com.au [211.30.103.113]) i5IGDWw22248; Sat, 19 Jun 2004 02:13:32 +1000 Received: from theinternet.com.au (localhost [127.0.0.1]) by theinternet.com.au (8.12.11/8.12.11) with ESMTP id i5IGD624045213; Sat, 19 Jun 2004 02:13:07 +1000 (EST) (envelope-from akm@theinternet.com.au) Received: (from akm@localhost) by theinternet.com.au (8.12.11/8.12.11/Submit) id i5IGD6uk045212; Sat, 19 Jun 2004 02:13:06 +1000 (EST) (envelope-from akm) Date: Sat, 19 Jun 2004 02:13:06 +1000 From: Andrew Milton To: Paul Dlug Message-ID: <20040618161306.GX80364@camelot.theinternet.com.au> Mail-Followup-To: Paul Dlug , freebsd-current@freebsd.org, Panagiotis Astithas References: <487C4BD2-C141-11D8-9D52-000393BB3E22@aps.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <487C4BD2-C141-11D8-9D52-000393BB3E22@aps.org> User-Agent: Mutt/1.5.6i cc: freebsd-current@freebsd.org cc: Panagiotis Astithas Subject: Re: Heap size limit in java X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2004 16:14:03 -0000 +-------[ Paul Dlug ]---------------------- | I originally posed to my question to freebsd-java. My issue was that I | was unable to set a java heap size of more than approx 2000m using java | (-Xmx2000m), it would fail with the error "COuld not reserve enough | space for object heap. | | Panagiotis Astithas looked into this a bit further and found that it | was due to the JVM being unable to mmap 3gb or more of memory. His | explanation is below along with some of the background information. | | Any help would be greatly appreciated. I imagine others have hit this | issue or will shortly. It's somewhat critical to getting large scale | java applications running on FreeBSD that the JVM be able to access | enough memory. I think it's pretty well summed up in the mmap manpage (if this is still currently correct). BUGS The len argument is limited to 2GB. Mmapping slightly more than 2GB does not work, but it is possible to map a window of size (filesize % 2GB) for file sizes of slightly less than 2G, 4GB, 6GB and 8GB. The limit is imposed for a variety of reasons. Most of them have to do with FreeBSD not wanting to use 64 bit offsets in the VM system due to the extreme performance penalty. So FreeBSD uses 32bit page indexes and this gives FreeBSD a maximum of 8TB filesizes. It is actually bugs in the file system code that causes the limit to be further restricted to 1TB (loss of precision when doing blockno calculations). Another reason for the 2GB limit is that file system metadata can reside at negative offsets. -- Totally Holistic Enterprises Internet| | Andrew Milton The Internet (Aust) Pty Ltd | M:+61 416 022 411 | ACN: 082 081 472 ABN: 83 082 081 472 |akm@theinternet.com.au| Carpe Daemon