<p>I've an application running on k8s and would like to updated the java heapsize .
I've updated the JAVA_OPTS environnement variable and set it in the deployment file as below</p>
<pre><code>- name: JAVA_OPTS
              value: &quot;-Xmx768m -XX:MaxMetaspaceSize=256m&quot;
</code></pre>
<p>but when i run the below command it looks like my changes does not takes effect</p>
<pre><code> java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
     intx CompilerThreadStackSize                   = 0                                   {pd product}
    uintx ErgoHeapSizeLimit                         = 0                                   {product}
    uintx HeapSizePerGCThread                       = 87241520                            {product}
    uintx InitialHeapSize                          := 33554432                            {product}
    uintx LargePageHeapSizeThreshold                = 134217728                           {product}
    uintx MaxHeapSize                              := 536870912                           {product}
     intx ThreadStackSize                           = 1024                                {pd product}
     intx VMThreadStackSize                         = 1024                                {pd product}
openjdk version &quot;1.8.0_212&quot;
OpenJDK Runtime Environment (IcedTea 3.12.0) (Alpine 8.212.04-r0)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
</code></pre>
<p>I'm i wrong can someone help me and explain how to set hose values ?</p>

<p>I see that you used OpenJDK Alpine to deploy a JAVA application, so you need to use this environment &quot;<strong>JAVA_TOOL_OPTIONS</strong>&quot; instead of &quot;<strong>JAVA_OPTS</strong>&quot;, something like:</p>
<pre><code>spec:
  containers:
  - name: jvm_options
    image: xxx:xxx
    env:
    - name: JAVA_TOOL_OPTIONS
      value: &quot;-Xmx768m -XX:MaxMetaspaceSize=256m&quot;
</code></pre>
<p>Once your application is running, you can check the application log and you will find the log below:</p>
<pre><code>Picked up JAVA_TOOL_OPTIONS: -Xmx768m -XX:MaxMetaspaceSize=256m
</code></pre>
