Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the minimum Metaspace in Java 8

I have the problem, that the default Metaspace size is too small.

Right after the startup of my (Tomcat and Spring based) web application, there is a major collection, because the Metaspace is exhausted. Before Java 8, I could set the initial PermGen size with -XX:PermSize. Now, I'm searching for a Java 8 equivalent for that, but I had no luck so far. I'm using the G1 garbage collector.

like image 657
Felix Avatar asked Jul 19 '14 14:07

Felix


1 Answers

To set the meta space to 100M, use -XX:MetaspaceSize=100M. https://blogs.oracle.com/poonam/entry/about_g1_garbage_collector_permanent

like image 102
Felix Avatar answered Oct 13 '22 20:10

Felix