Roger.H
Roger.H

Reputation: 353

Why Spring Metrics show initial heap size greater than max size?

My project is a Spring Boot application(ver=1.5.7.RELEASE, jdk=1.8.0_131) with JVM options: -Xms2048M -Xmx2048M -Xmn768M -XX:MaxMetaspaceSize=256M -XX:MetaspaceSize=256M.

I saw that init heap size is 2G, but max heap size is 1.9G in Spring Admin. How comes the gap? enter image description here

BTW, Metadata space size is 256M, why non-heap only 205.4M? How comes max non-heap size as 1.5G?

Upvotes: 0

Views: 811

Answers (1)

apangin
apangin

Reputation: 98284

I saw that init heap size is 2G, but max heap size is 1.9G in Spring Admin. How comes the gap?

One of survivor spaces of the heap is always empty and is not included in calculation of the maximum. See this question.

Metadata space size is 256M, why non-heap only 205.4M?

-XX:MetaspaceSize=256M does not set the initial Metaspace size. This is rather a threshold that triggers GC when reached. See JDK-8039867 for details.

How comes max non-heap size as 1.5G?

Non-Heap includes Metaspace (max 256M in your case), Compressed Class space (max 1G by default) and Code Cache (max 240M by default).

Upvotes: 2

Related Questions