-Xmx6048m -Xms6048m not working on docker

Hi,
I am running version 11.10.10 on docker (through k8s) and it seems that xmx values are being ignored, the container goes beyond 8GB of memory usage with such values being set. The values are passed through env variables.

          - name : JAVA_OPTS
            value: "-Xmx6048m -Xms6048m"
          - name : CATALINA_OPTS
            value: "-Xmx6048m -Xms6048m"
19-Oct-2020 14:08:49.436 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx6048m
19-Oct-2020 14:08:49.436 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms6048m

when doing ps on the console, you can still see everything looks alright.

root@itswiki-976b465cb-4bwr2:/usr/local/tomcat# ps aux|grep tomcat
root         1  5.9  5.7 12802732 3741984 ?    Ssl  14:08   1:44 /opt/java/openjdk/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xmx6048m -Xms6048m -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true -Djava.security.egd=file:/dev/./urandom -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Xmx6048m -Xms6048m -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start

Any idea why those settings are not taking effect ?

I see:

Current size of heap in bytes: 6341787648
Maximum size of heap in bytes. 6341787648
Amount of free memory within the heap in bytes: 5848430080

pasting the snippet into the wiki, but certainly the wiki goes beyond that, today it reached almost 10G when it hanged.

They are JVM parameters, not docker run parameters. They are thus independent of docker. How are you setting them ?

right, I am setting docker limits to 10G, and those JVM parameters through environment variables, but if the users start doing busy things in XWiki it starts eating memory and going beyond the 6GB defined as JVM