Profile Image
vishnupriya

What is Memory allocation for class metadata: -XX:MinMetaspaceFreeRatio?

What is Memory allocation for class metadata: -XX:MinMetaspaceFreeRatio? Have you used this JVM arguement before?What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvmargument

  • xx-minmetaspacefreeratio

  • x-minmetaspacefreeratio

  • Memory allocation for class metadata

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

You can set the minimum ratio of free space for metaspace region after garbage collection is finished:

 

-XX:MinMetaspaceFreeRatio =ratio, where ratio is the desired amount of memory available for class metadata in percentage.

 

Examples:

 

To set the metaspace memory ratio for class metadata 20%:

 

-XX:MinMetaspaceFreeRatio=20

 

Description:

 

Java classes have an internal representation within Java Hotspot VM and are referred to as class metadata. Prior Java 8, the class metadata was allocated in the so-called permanent generation. Since JDK 8, the permanent generation was removed and the class metadata is allocated in native memory. The amount of native memory that can be used for class metadata is by default unlimited. Use the option -XX: MinMetaspaceFreeRatio to set a required lower boundary ratio of metaspace region that needs to be available after garbage collection. In case of lower amount of memory available after garbage collection finished is lower than the threshold, the metaspace region will be resized.

 

Default Value:

 

The default size depends on the platform.

 

Errors:

 

None

 

Arguments related:

 

TODO link UseG1GC, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, UseSerialGC, USeParNewGC, UseParallelGC, UseZGC, MaxMetaspaceSize

 

Related Posts:

NOTE:

 

If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvmargument

  • xx-minmetaspacefreeratio

  • x-minmetaspacefreeratio

  • Memory allocation for class metadata