title: MaxHeapSize in Java
body: <p>I run command in window machine </p>
  
  <pre><code>java -XX:+PrintFlagsFinal -version | findstr /i "HeapSize PermSize ThreadStackSize
  </code></pre>
  
  <p>and got below value for <code>MaxHeapSize</code></p>
  
  <pre><code>2118123520
  </code></pre>
  
  <p>which is <code>2020MB</code> however, when I call <code>Runtime.getRuntime().maxMemory()</code> , it gives me <code>259522560</code> only i.e. <code>247MB</code> .</p>
  
  <p>Can anyone please suggest why I'm getting this mismatch ?</p>