I have a Tomcat container with a memory request of 62000Mi
. The JAVA_OPTS
environment variable contains -XX:InitialRAMPercentage=50.0
and -XX:MaxRAMPercentage=80.0
.
I was expecting the MaxHeapSize to be 80%
of the memory request so ~50GB
however the actual MaxHeapSize is ~30GB
so I am missing ~20GB
.
What could be the reason(s) that I don't get the expected MaxHeapSize? Is it feasible to use MaxRAMPercentage
on Kubernetes, or should I stick to Xmx
?
This is on Java 11. The Kubernetes worker node has 64GB
memory and is hosted on VMWare with dynamic memory allocation.