From: Lew on
Nigel Wade wrote:
> Ok, on a 32bit machine:
>
> $ java -Xmx2700m ParseTime
> Thu Jan 01 08:00:00 GMT 1970
> ...
>
> $ java -Xmx2800m ParseTime
> Error occurred during initialization of VM
> Could not reserve enough space for object heap
> Could not create the Java virtual machine.
>
> So, here I'm limited to 2.7GB on a stock openSUSE desktop with 3GB RAM
> and 4GB swap, running:
>
> $ java -version
> java version "1.6.0_15"

I couldn't be more glad to be proven wrong.

--
Lew
From: Nigel Wade on
On Wed, 25 Nov 2009 16:27:18 +0000, DuncanIdaho wrote:

> Nigel Wade wrote:
>> On Wed, 25 Nov 2009 09:19:16 -0500, Lew wrote:
>>
>>> Thomas Pornin wrote:
>>>> (**) With PAE, available since the Pentium Pro (that's more than
>>>> twelve years ago), a 32-bit x86 system may use up to 64 GB of RAM,
>>>> but not simultaneously: each single process may use only 4 GB.
>>> I'm aware of no 32b JVM that can specify a heap over about 1.8 GB;
>>> most are lower.
>
> snip
>
>> I should point out that this is a 32bit JVM running on a 64bit system
>> with 32GB of RAM. Nonetheless, the limit on a 32bit application is
>> still 4GB despite the 64bit OS. What it does mean, though, is that any
>> individual application has got a much greater chance of getting the
>> max. address space because the entire system isn't limited to 4GB.
>>
>> The same may be true of a PAE system, I don't know and can't test it.
>>
>>
> OK well I've ordered my new laptop with Windows 7
>
> By the way http://java.sun.com/javase/downloads/widget/jdk6.jsp offers
> JDK 6 Update 17 for Windows and Windows x64 where the archive for the 64
> bit version is smaller than that for the 32 bit version by around 8MB,
> interesting huh,

Well, the Linux 64bit version is about 1MB larger. It doesn't really tell
you anything about the unpacked size, or the size of running JVM.

> also, apparently the 64 bit release can be used in 32
> bit mode...

Maybe, maybe not:

$ /usr/java/jdk1.6.0_17/bin/java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

$ /usr/java/jdk1.6.0_17/bin/java -version -d32
Running a 32-bit JVM is not supported on this platform.

I don't know whether it works on Windows.

>
> Anyway, it will be interesting to see just how big the heap can be with
> a 64bit JVM running on a 64bit system. Roll on delivery day.
>

Whatever the limit of your VM is, presumably. Probably RAM+swap, or the
administrator/OS defined per-process VM limit. You can request max. heap
size much more than the available VM, but it's not actually physically
allocated until required, for example:

$ /usr/java/jdk1.6.0_17/bin/java -Xmx128000m -jar some.jar

works on a system with only 32GB RAM.

If, however, I restrict the per-process VM to 20GB using:

$ ulimit -v 20000000

I get:

$ /usr/java/jdk1.6.0_17/bin/java -Xmx20000m -jar dist/MP3FileCopier.jar .
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

but I can request 19GB.

As I said elsethread, taking up a few MB of extra space for 64bit
addresses is not something to be overly concerned about.

--
Nigel Wade