Understanding metaspace size

noob picture noob · Sep 14, 2016 · Viewed 13.1k times · Source

JVM Settings:

-Xms8192M
-Xmx8192M
-XX:NewRatio=1
-XX:SurvivorRatio=6
-XX:MetaspaceSize=256M
-XX:MaxMetaspaceSize=512M

Output of jstat is

S0C    S1C    S0U    S1U      EC       EU        OC         OU       MC     MU    CCSC   CCSU   YGC     YGCT    FGC    FGCT     GCT   
524288.0 524288.0  0.0   231108.3 3145728.0 2926008.3 4194304.0   73553.2   58624.0 56981.2 8960.0 8619.0      5    0.684   1      0.235    0.919

output of gccapacity is

NGCMN    NGCMX     NGC     S0C   S1C       EC      OGCMN      OGCMX       OGC         OC       MCMN     MCMX      MC     CCSMN    CCSMX     CCSC    YGC    FGC 
4194304.0 4194304.0 4194304.0 218624.0 208896.0 3766784.0  4194304.0  4194304.0  4194304.0  4194304.0      0.0 1099776.0  59136.0      0.0 1048576.0   8960.0     26     1

In both the above output size of metaspace is around 56M even though minimum metaspaceSize is defined as 256m

Answer

Jade Tang picture Jade Tang · Jan 29, 2018

you need turn off the UseCompressedClassPointers which will create a space in metaspace.