RFR: 5705: Explain metaspace in rule results

Henrik Dafgård hdafgard at openjdk.org
Sat Jun 14 14:55:35 UTC 2025


On Sun, 8 Jun 2025 18:34:07 GMT, Suchita Chaturvedi <schaturvedi at openjdk.org> wrote:

> This enhancement updates MetaspaceOomRule and IncreasingMetaspaceLiveSetRule with the proper explanation and relevant real time values which were missing.

core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties line 523:

> 521: ManyRunningProcessesRule_INFO_LIMIT_LONG=The number of simultaneous processes needed to trigger an info notice
> 522: MetaspaceOomRuleFactory_RULE_NAME=Metaspace Out of Memory
> 523: MetaspaceOomRuleFactory_TEXT_CAUSE=Java class metadata is allocated in native memory (metaspace). When the amount of native memory needed for a class metadata exceeds MaxMetaSpaceSize, a java.lang.OutOfMemoryError exception with a detail MetaSpace is thrown. The amount of metaspace that can be used for class metadata is limited by the parameter MaxMetaSpaceSize, which is specified on the command line.

It should be MaxMetaspaceSize, not MaxMetaSpaceSize.

core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties line 524:

> 522: MetaspaceOomRuleFactory_RULE_NAME=Metaspace Out of Memory
> 523: MetaspaceOomRuleFactory_TEXT_CAUSE=Java class metadata is allocated in native memory (metaspace). When the amount of native memory needed for a class metadata exceeds MaxMetaSpaceSize, a java.lang.OutOfMemoryError exception with a detail MetaSpace is thrown. The amount of metaspace that can be used for class metadata is limited by the parameter MaxMetaSpaceSize, which is specified on the command line.
> 524: MetaspaceOomRuleFactory_TEXT_ACTION=If MaxMetaSpaceSize, has been set on the command-line, increase its value. MetaSpace is allocated from the same address spaces as the Java heap. Reducing the size of the Java heap will make more space available for MetaSpace.

Not a blocker, but I think it'd be nice if we checked the flag events (if available). We can say both what the current value is, and if it was set on the command line adjust the text. Something like "MaxMetaspaceSize was set to {maxMetaspaceSize} on the command line, increasing this value may help resolve the error."

-------------

PR Review Comment: https://git.openjdk.org/jmc/pull/654#discussion_r2146973008
PR Review Comment: https://git.openjdk.org/jmc/pull/654#discussion_r2146972412


More information about the jmc-dev mailing list