Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 8 Metaspace - Avoid decrease

I've got a short question due to Metaspace in Java 8. I know that I can set an initial size with the -XX:MetaspaceSize - Parameter. But I wonder if it's possible to configure that this value will be the minimum size.

My target is to prevent Full GCs due to Metaspace sizing. Usually 512 MB should be enough Metaspace for my application, but this value can differ over runtime. If more than 512 MB are needed (which should not happen) a Full GC can't be avoided, that's clear.

Regards, Mathias

like image 774
AnarchoEnte Avatar asked Mar 09 '26 23:03

AnarchoEnte


1 Answers

Setting MaxMetaspaceFreeRatio=100 should prevent it from shrinking

like image 78
the8472 Avatar answered Mar 11 '26 12:03

the8472



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!