<p>I'm running java application(ksqldb 0.15.0) on GKE cluster, and passed the java opts <code>-Xms3G</code> and <code>-Xmx5G</code>.</p>
<p><code>-Xmx</code> option is working well, but <code>-Xms</code> options seems not to be effected.</p>
<p>The running command is as follows;</p>
<pre><code>java -cp /usr/share/java/ksqldb-rest-app/*: -Xms3G -Xmx5G -server -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBeforeRemark -XX:+ExplicitGCInvokesConcurrent -XX:NewRatio=1 -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dksql.log.dir=/usr/logs -Dlog4j.configuration=file:/etc/ksqldb/log4j.properties -Dksql.server.install.dir=/usr -Xlog:gc*:file=/usr/logs/ksql-server-gc.log:time,tags:filecount=10,filesize=102400 io.confluent.ksql.rest.server.KsqlServerMain /etc/ksqldb/ksqldb-server.properties
</code></pre>
<p>To investigate, I issued <code>jstat</code> command, and the result was like below;</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">NGCMN</th>
<th style="text-align: left;">NGCMX</th>
<th style="text-align: left;">NGC</th>
<th style="text-align: left;">S0C</th>
<th style="text-align: left;">S1C</th>
<th style="text-align: left;">EC</th>
<th style="text-align: left;">OGCMN</th>
<th style="text-align: left;">OGCMX</th>
<th style="text-align: left;">OGC</th>
<th style="text-align: left;">OC</th>
<th style="text-align: left;">MCMN</th>
<th style="text-align: left;">MCMX</th>
<th style="text-align: left;">MC</th>
<th style="text-align: left;">CCSMN</th>
<th style="text-align: left;">CCSMX</th>
<th style="text-align: left;">CCSC</th>
<th style="text-align: left;">YGC</th>
<th style="text-align: left;">FGC</th>
<th style="text-align: left;">CGC</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">192</td>
<td style="text-align: left;">2621440</td>
<td style="text-align: left;">1572864</td>
<td style="text-align: left;">157248</td>
<td style="text-align: left;">157248</td>
<td style="text-align: left;">1258368</td>
<td style="text-align: left;">64</td>
<td style="text-align: left;">2621440</td>
<td style="text-align: left;">1572864</td>
<td style="text-align: left;">1572864</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">1163264</td>
<td style="text-align: left;">132268</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">1048576</td>
<td style="text-align: left;">18828</td>
<td style="text-align: left;">505</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">4</td>
</tr>
</tbody>
</table>
</div>
<p>Expected value of the sum of <code>NGCMN + OGCMN</code> is 3145728 (=3GB), but the actual value is 256.<br />
However, the sum of <code>NGCMX + OGCMX</code> is 5242880(=5GB), so <code>-Xmx</code> options is correctly effected.</p>
<p>The Host that the pod is running on has 15GB of physical memories.</p>
<p>Am I missing something?</p>

shota hizawa
<p><code>-Xms</code> sets the <em>initial</em> heap size, not the minimum size.</p>
<p><code>NGCMN</code> and <code>OGCMN</code> denote the minimum capacity of the new generation and the old generation respectively. These numbers are useless most of the time. What you probably wanted to look at is <code>NGC</code>/<code>OGC</code> - the <em>current</em> capacity of the new generation and the old generation.</p>
<p>You've set <code>-Xms3G</code>, and the current heap size is exactly</p>
<pre><code>NGC + OGC = 1572864 + 1572864 KB = 3 GB
</code></pre>
