title: Java heap space does not get increased using -Xmx 1g
body: <p>I am doing some fancy stuff, where I really need to allocate about 1 GB. </p>
  
  <p>My Computer has 8GB 64 bit System, so that's not a problem. </p>
  
  <p>I use <code>-Xmx 4g</code> to increase my heap space, but sadly enough that doesn't work at all.</p>
  
  <p>I use:</p>
  
  <pre><code>Runtime rt = Runtime.getRuntime();
  long totalMem = rt.totalMemory();
  long maxMem = rt.maxMemory();
  long freeMem = rt.freeMemory();
  double megs = 1048576.0;
  
  System.out.println ("Total Memory: " + totalMem + " (" + (totalMem/megs) + " MiB)");
  System.out.println ("Max Memory:   " + maxMem + " (" + (maxMem/megs) + " MiB)");
  System.out.println ("Free Memory:  " + freeMem + " (" + (freeMem/megs) + " MiB)");
  </code></pre>
  
  <p>Which shows me:</p>
  
  <pre><code>Total Memory: 259522560 (247.5 MiB
  Max Memory:   259522560 (247.5 MiB)
  Free Memory:  0 (0 MiB)
  </code></pre>
  
  <p>I really don't know what I am doing wrong. Does anyone of you have an idea?</p>
  
  <p>Thanks a lot!</p>