Home » Java » How can “max” heap value be less than “init” in the java.lang.Memory MXBean?

How can “max” heap value be less than “init” in the java.lang.Memory MXBean?

Posted by: admin May 17, 2018 Leave a comment

Questions:

Inspecting a running application via JMX, the java.lang.Memory MXBean reports the following values for HeapMemoryUsage:

committed  102900432896
init       107374182400
max        102900432896
used        16651836472

Based on my understanding from the Javadoc, it seems that init and max should correspond to the JVM parameters -Xms and -Xmx, respectively. Knowing that the heap should not shrink below the initial size and that the JVM will not accept an Xms value larger than Xmx, why is the reported max value less than init by about 4GB? How should I interpret these numbers?

Answers: