<p>I am trying to set Xmx value in my Dockerfile as:<br></p>
<pre><code>CMD [&quot;java&quot;,&quot;-Xmx1024m -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow&quot;,&quot;-jar&quot;, \ 
...
...
&quot;/home/app/accountowner-extraction.jar&quot;]
EXPOSE 8080
</code></pre>
<p>I am getting an error as:</p>
<pre><code>C:\Users\nisarg&gt;kubectl logs my-validation-app-blhr6
Invalid maximum heap size: -Xmx1024m -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
</code></pre>
<p>Below is resource allocation :</p>
<pre><code>    Limits:
      cpu:     2
      memory:  2500M
    Requests:
      cpu:      1500m
      memory:   2G
</code></pre>
<p>Is it because I am not explicitly setting -Xms?<br>
Are there any changes that should be done in memory allocation?</p>

Nisarg Patil
<p>Don't write all options in one argument, use separate arguments:</p>
<pre><code>CMD [&quot;java&quot;,&quot;-Xmx1024m&quot;,&quot;-XX:+UseG1GC&quot;,&quot;-XX:-OmitStackTraceInFastThrow&quot;,&quot;-jar&quot;, \ 
</code></pre>
