Is there any recommended Metaspace setup size for Wildfly?

11.4k views Asked by At

Is there any best practice for Metaspace Size with WildFly?

Example, for the max heap memory I'd the following setup:

((Memory without Wildfly running) * 2) - (Total amount of available memory)

I know that Metaspace auto increase if I don't specify MaxMetaspaceSize, but is this a good practice?

Thanks in advance

1

There are 1 answers

0
mrts On BEST ANSWER

The WildFly application server sets the initial and maximum metaspace value in standalone.conf to 96 MB / 256 MB respectively as follows:

... -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=256m ... -Xmx512m ...

However, MaxMetaspaceSize usually needs to be much larger in large production applications as it needs to contain metadata for all loaded classes in the application. Setting it to half of the maximum heap size (-Xmx) as WildFly does seems a safe bet as it will be garbage collected as necessary by the JVM.