Applications is slowing with metaspace growth

时间:2018-10-24 11:23:57

标签: performance grails groovy java-8 metaspace

I just moved from grails 2.4.3 to grails 2.5.6 and from Java 7 to Java 8. I'm trying to set optimal metaspace size in my app.

Actual metaspace size has big impact on application performance:

Used metaspace and response avg time:

  • 200 MB - 339 ms
  • 300 MB - 380 ms
  • 400 MB - 430 ms
  • 500 MB - 460 ms
  • 600 MB - 530 ms

Metaspace is growing from application start to 620MB in 90 minutes.

This is my actual gc settings:

 -Xms14G -Xmx14G\
 -XX:+UseG1GC\
 -XX:ParallelGCThreads=8\
 -XX:ConcGCThreads=4\
 -XX:MaxGCPauseMillis=200\
 -XX:+UseLargePages\
 -XX:+UseLargePagesInMetaspace\
 -XX:+AlwaysPreTouch\
 -XX:InitialBootClassLoaderMetaspaceSize=512M\
 -XX:MetaspaceSize=512M\
 -XX:MinMetaspaceExpansion=8M\
 -XX:MaxMetaspaceExpansion=32M\
 -XX:+UseStringDeduplication\
 -XX:+ParallelRefProcEnabled\
 -XX:-TieredCompilation\

When MaxMetaspaceSize was set to 512M then after few hours of running my app is slowing down 1 or 2 times for hour. Respons time is around 10 seconds then.

Anyone had such problem? In yours applications metaspace has such impact on performance?

1 个答案:

答案 0 :(得分:0)

您是否已对应用程序进行了配置?

我想说的是Metaspace garbage collection在这里。它收集死掉的类和类加载器,并在类元数据使用量达到MaxMetaspaceSize(由-XX:MaxMetaspaceSize缩小)后触发。