title: 32bit JVM: Maximum Heap space?
body: <p>I DO know that the maximum Heap space of a 32bit JVM is said to be 2G, but I experimentally found that I can only allocate a varying space of around 1290M, sometimes more, sometimes less.
  (Sometimes I can safely allocate more, sometimes I get an error even at that number.)</p>
  
  <p>I also have a 64bit JRE and my OS is Win7 64bit, so that can barely restrict the RAM usage.</p>
  
  <p>I have no problems with that since I can simply use the 64bit JVM instead, but the more precise the things you know are, the better you can help others.</p>
  
  <p>So I wonder: Why do I get this weird maximum heap area?</p>
  
  <p>I used cmd commands like</p>
  
  <pre><code>"%java32%" -xmx****M Program
  </code></pre>
  
  <p>With varying numbers for xmx and java32 as a variable that points to a 32bit JRE.</p>
  
  <p>I DID look for this topic at other places, but either it is nowhere else or I am not very skilled at searching.</p>
  
  <p>EDIT:</p>
  
  <p>allocate is inaccurate, since I did not use that memory, I just asked the System for it.</p>
  
  <p>The 64bit JRE of course allows Heap spaces even above 4G.</p>