Skip to content

JVM 参数 -XX:MetaspaceSize 解释错误 #1947

Open
@qtoo

Description

@qtoo

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,过程详见:

JVM 参数 MetaspaceSize 的误解

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugContent error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions