title: Heap size is greater than -Xmx
body: <p>I set the initial and maximum Java heap size to 256MB using <a href="https://stackoverflow.com/a/14763095/3460717"><code>-Xms256m</code> and <code>-Xmx256m</code> JVM options</a>. The GC log (using <code>-XX:+PrintHeapAtGC</code>) states that the heap size is <code>251904K</code> (246MB), which is <a href="https://stackoverflow.com/q/28362435/3460717">smaller than the minimum heap size, <code>-Xms256m</code></a> (see last line of log). However, this is because <a href="https://stackoverflow.com/a/28362436/3460717">the stated heap size is the <strong>available</strong> heap size</a>, which does not include <a href="https://stackoverflow.com/questions/28347161/missing-memory-size-of-young-generation-includes-only-one-survivor-space">the <strong>unavailable</strong> <em>from space</em></a>. </p>
  
  <p>When I manually include the unavailable <em>from space</em> memory, the derived heap size is <code>262656K</code> (256.5MB), which is slightly <strong>larger than the maximum heap size, <code>-Xmx</code></strong> (by 512KB):</p>
  
  <pre><code>[heap size] = [eden space size] + [from space size] + [to space size] + [OldGen size]
    262656K   =       66048K      +       10752K      +     10752K      + 175104K
  </code></pre>
  
  <p><strong>Why is the heap size slightly larger than the maximum heap size, <code>-Xmx</code>?</strong></p>