Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MaxMetaSpace and CompressedClassSpaceSize

Can I understand when UseCompressedClassPointers is enabled, MaxMetaspace is not relevance and CompressedClassSpaceSize determines the size of the metaspace?.

Because from Oracle doc https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/memleaks002.html (section Exception in thread thread_name: java.lang.OutOfMemoryError: Compressed class space)

  • If the UseCompressedClassPointers is used, the amount of space
    available for class metadata is fixed at the amount
    CompressedClassSpaceSize. If the space needed for
    UseCompressedClassPointers exceeds CompressedClassSpaceSize, a
    java.lang.OutOfMemoryError with detail Compressed class space is
    thrown.

kindly point me to some link that explains what is stored in CompressedClassSpaceSize & Metaspace

like image 989
null Avatar asked Sep 13 '26 09:09

null


1 Answers

CompressedClassSpaceSize determines the size of the metaspace

No, it's incorrect. Compressed class space is an memory region inside Metaspace. So MaxMetaspaceSize option always works and limits both Metaspace and inner Compressed class space.
If you try to set CompressedClassSpaceSize greater than MaxMetaspaceSize it will not make an effect.
See Is CompressedClassSpaceSize area contains MaxMetaspaceSize area?
See also https://stuefe.de/posts/metaspace/what-is-metaspace/

like image 101
Ivan Vakhrushev Avatar answered Sep 15 '26 00:09

Ivan Vakhrushev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!