Guidelines to set MetaspaceSize - java 8
<p>What is the default value of MetaspaceSize for 64-bit servers? I couldn't find it in the official documentation.</p>

<p>I'm observing that in a server JVM process, at times, the GC frequency becomes high and keeps growing. If I restart the service a few times, it returns to stable. I think its due to the JRE upgrade. </p>

<p>JVM Heap max size is set to be 6GB but when this problem occurs, we see only 3GB heap being used. Metaspace grows by very little and is almost always full. I tried increasing the metaspace to 1GB and it improves the throughput.</p>

<p>I think what is happening is Metaspace by default is set to a very low value and thus GC kicks in. High water mark is continuously increased(again by a very low amount) every time a GC occurs. </p>

<p>I want to set the MetaspaceSize (not sure what is the current value). </p>

<p>Oracle docs say there are no guidelines to know what to set MetaspaceSize to. But is there a way to find out what would be the correct value to set it to?</p>

<p>One hint I got from Oracle docs is this:</p>

<p><code>If the committed space available for class metadata as a percentage of the total committed space for class metadata is greater than MaxMetaspaceFreeRatio, then the high-water mark will be lowered. If it is less than MinMetaspaceFreeRatio, then the high-water mark will be raised.</code></p>

<p>But still not able to figure out how to stabilize the GCs..I have three questions:</p>

<ol>
<li>What is the default MetaspaceSize on 64 bit servers?</li>
<li>What are the default ratios: MaxMetaspaceFreeRatio, MinMetaspaceFreeRatio set to? Answer: It shows Min is 40, Max is 70 </li>
<li>How to go about deciding oon a Metaspacesize value?</li>
</ol>