Why different default values for MetaspaceSize?

Coleen Phillimore coleen.phillimore at oracle.com
Wed Feb 17 14:56:29 UTC 2021



On 2/17/21 8:08 AM, Thomas Stüfe wrote:
> Hi,
>
> Does anyone know why the default for MetaspaceSize (the initial threshold
> which triggers the first metaspace-motivated GC) is cpu- and
> compiler-tier-dependent?
>
> IIUC this has been the way since PermGen removal.

The MetaspaceSize option came from PermSize which was platform 
dependent.  I don't think it needs to be like that now.
Some configurations may way to ergonomically set MetaspaceSize larger to 
prevent early GCs but that shouldn't be platform dependent.
The ScaleForWordSize is a macro that increases the size for 64 bits.  
I'm not sure if that's still needed but that should cover any 32/64 bit 
dependencies on the size you pick as the default (between 16 and 12M).  
Thanks to StefanK for consultation.

Coleen


>
> I can see a vague connection between compiler tier and this size since
> MethodCounters live in metaspace and we probably have more of them with C2?
> I'm guessing here. But the size difference is not large at all (16m vs 12m)
> and probably does not make a big difference. Why not just set it to one
> default size?
>
> Thanks, Thomas



More information about the hotspot-runtime-dev mailing list