2

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

Jens
  • 67,715
  • 15
  • 98
  • 113
noob
  • 109
  • 1
  • 2
  • 8
  • 1
    `-XX:MetaspaceSize=256M` does *not* configure a minimum size. It does not even configure an actual size of any kind. – Holger Sep 14 '16 at 13:46
  • So what does that mean. Is there a way for me to force the metaspace size ? Currently metaspace size utilization is reaching 90% is it bad? any way to avoid it ? – noob Sep 14 '16 at 18:48
  • 5
    See [Advanced Garbage Collection Options](http://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html#BABFAFAE): `-XX:MetaspaceSize=size`: *Sets the size of the allocated class metadata space that will trigger a garbage collection the first time it is exceeded. This threshold for a garbage collection is increased or decreased depending on the amount of metadata used* So this option only specifies a threshold for triggering garbage collection and it might even change later-on. There is no reason to worry about the utilization. The size will be increased when necessary. – Holger Sep 14 '16 at 19:30
  • (1) i'd edit this question to be more clear, and ask the question asked in the comments (i.e., why doesn't this work); (2) I'd make the comment by Holger the definition in the answer, and append it to Jade Tang's comment on turning off `UseCompressedClassPointers` if that actually fixed the issue. – Scott Skiles Apr 14 '20 at 15:49

1 Answers1

0

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

Jade Tang
  • 321
  • 4
  • 23