It seems that JavaSE8's -XX;MetaspaceSize does not affect the initial metaspace size.
This is different from the behavior of -Xms and -XX:InitialCodeCodeSize. These options will set the initial commit charge for the Java Heap and CodeCache. -XX:MetaspaceSize does not affect initial metaspace commit charge."
I have executed the JmxLoop test attached upon jdk8u25 linux+x86 JVM with several different values of JVM option InitialBootClassLoaderMetaspaceSize. Test results are shwon below.
What is the releationship between InitialBootClassLoaderMetaspaceSize JVM option and -XX:MaxMetaspaceSize JVM option ?
JVM options used for the tests:
-Xms8M -Xmx8M -XX:InitialCodeCacheSize=4M -XX:ReservedCodeCacheSize=4M \
-XX:+UseLargePagesInMetaspace -XX:+UseLargePages \
-XX:InitialBootClassLoaderMetaspaceSize=xM -XX:MaxMetaspaceSize=8M \
-XX:+UnlockDiagnosticVMOptions \
-XX:NativeMemoryTracking=summary \
-XX:+PrintNMTStatistics \
JmxLoop
(1) -XX:InitialBootClassLoaderMetaspaceSize=1M
Metaspace
currentUsage
init = 0(0K) used = 1662656(1623K) committed = 4194304(4096K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1662656(1623K) committed = 4194304(4096K) max = 8388608(8192K)
(2) -XX:InitialBootClassLoaderMetaspaceSize=2M
Metaspace
currentUsage
init = 0(0K) used = 1656792(1617K) committed = 4194304(4096K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1656792(1617K) committed = 4194304(4096K) max = 8388608(8192K)
(3) -XX:InitialBootClassLoaderMetaspaceSize=3M
Metaspace
currentUsage
init = 0(0K) used = 1656824(1617K) committed = 4194304(4096K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1656824(1617K) committed = 4194304(4096K) max = 8388608(8192K)
(4) -XX:InitialBootClassLoaderMetaspaceSize=4M
Metaspace
currentUsage
init = 0(0K) used = 1656824(1617K) committed = 8388608(8192K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1656824(1617K) committed = 8388608(8192K) max = 8388608(8192K)
(5) -XX:InitialBootClassLoaderMetaspaceSize=5M
Metaspace
currentUsage
init = 0(0K) used = 1656824(1617K) committed = 8388608(8192K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1656824(1617K) committed = 8388608(8192K) max = 8388608(8192K)
Why does the committed metaspace size become 4M * 2 = 8M in case that -XX:InitialBootClassLoaderMetaspaceSize is specified as 4M or larger?
.
This is different from the behavior of -Xms and -XX:InitialCodeCodeSize. These options will set the initial commit charge for the Java Heap and CodeCache. -XX:MetaspaceSize does not affect initial metaspace commit charge."
I have executed the JmxLoop test attached upon jdk8u25 linux+x86 JVM with several different values of JVM option InitialBootClassLoaderMetaspaceSize. Test results are shwon below.
What is the releationship between InitialBootClassLoaderMetaspaceSize JVM option and -XX:MaxMetaspaceSize JVM option ?
JVM options used for the tests:
-Xms8M -Xmx8M -XX:InitialCodeCacheSize=4M -XX:ReservedCodeCacheSize=4M \
-XX:+UseLargePagesInMetaspace -XX:+UseLargePages \
-XX:InitialBootClassLoaderMetaspaceSize=xM -XX:MaxMetaspaceSize=8M \
-XX:+UnlockDiagnosticVMOptions \
-XX:NativeMemoryTracking=summary \
-XX:+PrintNMTStatistics \
JmxLoop
(1) -XX:InitialBootClassLoaderMetaspaceSize=1M
Metaspace
currentUsage
init = 0(0K) used = 1662656(1623K) committed = 4194304(4096K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1662656(1623K) committed = 4194304(4096K) max = 8388608(8192K)
(2) -XX:InitialBootClassLoaderMetaspaceSize=2M
Metaspace
currentUsage
init = 0(0K) used = 1656792(1617K) committed = 4194304(4096K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1656792(1617K) committed = 4194304(4096K) max = 8388608(8192K)
(3) -XX:InitialBootClassLoaderMetaspaceSize=3M
Metaspace
currentUsage
init = 0(0K) used = 1656824(1617K) committed = 4194304(4096K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1656824(1617K) committed = 4194304(4096K) max = 8388608(8192K)
(4) -XX:InitialBootClassLoaderMetaspaceSize=4M
Metaspace
currentUsage
init = 0(0K) used = 1656824(1617K) committed = 8388608(8192K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1656824(1617K) committed = 8388608(8192K) max = 8388608(8192K)
(5) -XX:InitialBootClassLoaderMetaspaceSize=5M
Metaspace
currentUsage
init = 0(0K) used = 1656824(1617K) committed = 8388608(8192K) max = 8388608(8192K)
peakUsage
init = 0(0K) used = 1656824(1617K) committed = 8388608(8192K) max = 8388608(8192K)
Why does the committed metaspace size become 4M * 2 = 8M in case that -XX:InitialBootClassLoaderMetaspaceSize is specified as 4M or larger?
.
- duplicates
-
JDK-8151845 Comment in globals.hpp for MetaspaceSize is incorrect.
-
- Resolved
-