I'm running a containerized java application in Kubernetes.
In order to make the jvm reserve memory according to the container specifications, the flags -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
must be set.
If both those flags are set along with Xms and Xmx flags, what would the behavior of the jvm be? Do one flag overwrite the other?
For example, if we had java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Xms -Xms2500M -Xmx2500M -jar myjar.jar
in a pod with container limits 4Gi for requests and 4Gi for responses, in a host machine that has 128Gi memory, how much memory would the JVM reserve?