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
The WildFly application server sets the initial and maximum metaspace value in
standalone.conf
to 96 MB / 256 MB respectively as follows: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.