title: What is the default maximum heap size for Sun's JVM from Java SE 6?
body: <p>What is the default maximum heap size for Sun's JVM from Java SE 6 (i.e. equivalent to setting -Xmx)?</p>
  
  <p>Looks like for Java SE 5 with a server-class machine, <a href="http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html" rel="noreferrer">it's</a></p>
  
  <blockquote>
    <p>Smaller of 1/4th of the physical memory or 1GB.</p>
  </blockquote>
  
  <p>Bonus question: Looks like for IBM's JVM you can <a href="https://stackoverflow.com/questions/1572738/whats-the-default-heap-size-for-ibms-j9vm">ask it</a></p>
  
  <pre><code>java -verbose:sizes -version
  </code></pre>
  
  <p>Can you similarly ask Sun's JVM?</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>I used Runtime.getRuntime().maxMemory to confirm min(physical memory/4, 1G), referenced in <a href="http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html" rel="noreferrer">Sun documentation</a>.</p>