Open
Description
JVM 参数章节 jvm-parameters-intro.md: L98 中提到:
-XX:MetaspaceSize=N #设置 Metaspace 的初始(和最小大小)
此处解释错误,即 Metaspace 的初始大小非由 -XX:MetaspaceSize
设置。
参见 Oracle 官方文档 Other Considerations 中提到:
When the space committed for class metadata reaches a certain level (a high-water mark), a garbage collection is induced.
The high-water mark is initially set to the value of the command-line option MetaspaceSize.
可见 -XX:MetaspaceSize
是一个提前设定的阈值,会触发 GC,那一定不是初始大小。
通过实验证实 Metaspace 的初始大小非由 -XX:MetaspaceSize
设置,而是会引起 Full GC,过程详见: