MaxMetaspaceSize
MaxMetaspaceSize is a Java Virtual Machine (JVM) option that limits the maximum amount of native memory that may be used for metaspace, the area that stores class metadata. Introduced in Java 8 as a replacement for PermGen, metaspace memory is allocated from native memory and is separate from the Java heap. Metaspace grows as new classes are loaded and can shrink when classloaders are garbage collected and classes are unloaded.
If MaxMetaspaceSize is not set, metaspace can grow dynamically up to the limits of the process and
Two related options control metaspace behavior. -XX:MetaspaceSize specifies the initial threshold for metaspace; when usage exceeds
Practical tuning involves balancing memory footprint with class loading behavior. Metaspace usage can rise in environments