JVM max heap size

Hi,

JVMs have a max heap memory size. I thought until recently that this was limited by the type of addresses supported by jvm / os / hardware - for example 32-bit or 64-bit. So that for a 32-bit JVM the max heap size is 2^32 ~ 3 GB.

Now I have heard that some JVMs can actually have a much larger heap than this allthough only a 32-bit jvm.

Also, I heard that this only applies for Sun Solaris (not sure if any specific version) since it is the only OS not limiting the heap size of the JVM. Is this really true ?

I guess the JVM vendor have implemented some memory address manipulation inside the JVM to facilitate larger heap size than "normal" 32-bit - but is it only Solaris that allows you to do this kind of address manipulation ?

We run on a 64-bit AIX platform with IBM JVM 1.4, but can't get the JVM stable with heap set higher than ~1.7 G. We can't change to 64-bit JVM since the application we run does not support that.

Anyone know if another JVM would run on AIX with higher heap size - at least in theory ?

Thanks for any comments making this more clear to me !

[1129 byte] By [bombaa] at [2007-10-3 4:59:16]
# 1
HAI
NIRANJANAAa at 2007-7-14 23:04:40 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
In our dev environment, machine is 32bit OSand hence, we can't set heap size > 2.6 GB.We tried and read many articles but it is limitation from OS side and not Java.
krunalsa at 2007-7-14 23:04:40 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

The ultimate limitation is the address size -- whether pointers are stored as 32 or 64 bits. For 32 bit pointers this limit is 4,294,967,296. Other system limitations may (and certainly will, in the case of 64-bit) drop the limit further.

On some architectures it's technically possible for the OS to be running in 32 bit mode while some applications (including Java) run in 64 bit mode. Not sure to what extent this may be done on Solaris or any other specific OS, though.

In addition, there is a "hack" of sorts that may be used with large arrays: The arrays are allocated in a different address space (or in a shared "swap" area of the JVMs address space) and the hardware translation registers are manipulated to "page" the arrays in and out. Again, not sure whether this is done in any specific JVM -- just know that it's possible with some OSes.

Hotlicksa at 2007-7-14 23:04:40 > top of Java-index,Java HotSpot Virtual Machine,Specifications...