This is the ticket to perform the analogous changes made to core in
WFCORE-1319 regarding default MetasizeSpace, for Wildfly.
Since PermGen is no longer used, and has been replaced by Metasize, we probably need to alter the initial startup values. Current WF is using:
After some testing with garbage collection logging on (-verbose:gc -Xloggc:hcgc.log -XX:+PrintGCDateStamps -XX:MetaspaceSize=XX), the GC logs were monitored for at least one occurrence of a full GC due to Metadata threshold (example [Full GC (Metadata GC Threshold) 39592K->20187K). Using this information, minimum levels of Metasize for various configurations were determined.
The numbers below are the values used for -XX:MetaspaceSize=XXM followed by the number of full GCs triggered at that amount measured during boot of WF10-full:
standalone.xml 52MB(1), 53MB(0)
standalone-full.xml 64MB(1), 65MB(0)
standalone-ha.xml 52MB(1), 54MB(0)
standalone-full-ha.xml 79MB(1), 80MB(0)
For domain mode, the corresponding values were determined to be:
Process Controller: 12MB(1), 13MB(0)
Host Controller: 39MB(1), 40MB(0)
In domain mode, a very slight, non-scientifically measured boot time difference was observed (1769ms default Metasize vs 1694ms with 40m MetaSize set for host controller).
The approximate cost of increasing MetaSize over the default is summerized below (using top to collect RSS after server boot):
JBoss AS 7.1.1: (default permgen (-XX:PermSize=256m -XX:MaxPermSize=256m), JDK 7)
Wildfly 10: (default Metasize == 21M)
Wildfly 10: (Metasize == 64M)
Wildfly 10: (Metasize == 96M)
Additional measurements. Using just Wildfly-core, the following RSS sizes are measured for the indicated Metasize:
Wildfly-10 Core master
There is little boot time impact on the change:
Wildfly-10 Core master
|Metasize||Boot time (MS)|
Based on the memory impact of defaulting to 96M (approx 30mb initially over the default value of 21mb), it would seem to make sense to use this as a default value, which allows maintaining boot times without incurring a full GC due to Metasize and provides enough initial Metasize to both start the application server and perhaps deploy an application without incurring any performance penalty.
An additional note: host*.xml has JVM params set to MetaspaceSize=256m, which is probably too large an initial value.