title: Read maximum heap space at runtime
body: <p>As we all know, the <code>java -Xmx</code> option is used to set the maximum heap space available to a Java program. But is there a way for a Java program to read the value that has been set? Something like <code>System.getMaximumHeapSpace()</code> (which does not exist).</p>