Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jun 2004 02:13:06 +1000
From:      Andrew Milton <akm@theinternet.com.au>
To:        Paul Dlug <paul@aps.org>
Cc:        Panagiotis Astithas <past@noc.ntua.gr>
Subject:   Re: Heap size limit in java
Message-ID:  <20040618161306.GX80364@camelot.theinternet.com.au>
In-Reply-To: <487C4BD2-C141-11D8-9D52-000393BB3E22@aps.org>
References:  <487C4BD2-C141-11D8-9D52-000393BB3E22@aps.org>

next in thread | previous in thread | raw e-mail | index | archive | help
+-------[ 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040618161306.GX80364>