Why am I able to set -Xmx to a value greater than physical and virtual memory on the machine on both Windows and Solaris?
<p>On a 64-bit Windows machine with 12GB of RAM and 33GB of Virtual Memory (per Task Manager), I'm able to run Java (1.6.0_03-b05) with an impossible -Xmx setting of 3.5TB but it fails with 35TB.  What's the logic behind when it works and when it fails?  The error at 35TB seems to imply that it's trying to reserve space at startup.  Why would it do that for -Xmx (as opposed to -Xms)?</p>

<pre>
C:\temp>java -Xmx3500g ostest  
os.arch=amd64  
13781729280 Bytes RAM

C:\temp>java -Xmx35000g ostest  
Error occurred during initialization of VM  
Could not reserve enough space for object heap  
Could not create the Java virtual machine. 
</pre>

<p>On Solaris (4GB RAM, Java 1.5.0_16), I pretty much gave up at 1 PB on how high I can set -Xmx.  I don't understand the logic for when it will error out on the -Xmx setting.</p>

<pre>
devsun1.mgo:/export/home/mgo> java -d64 -Xmx1000000g ostest
os.arch=sparcv9
4294967296 Bytes RAM
</pre>
