6

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?

jnr
  • 121
  • 5
  • 1
    I'm voting to close this question as off-topic because questions like "Anyone had such problem? In yours applications metaspace has such impact on performance?" are not useful to have on StackOverflow. – Jeff Scott Brown Oct 24 '18 at 14:06

1 Answers1

1

Have you profiled your app?

I'd say that Metaspace garbage collection was involved here. It collects dead classes and classloaders and it's triggered once the class metadata usage reaches the MaxMetaspaceSize (which was narrowed by -XX:MaxMetaspaceSize).

Michal_Szulc
  • 4,097
  • 6
  • 32
  • 59
  • When metaspace riches max value and gc is clearing metaspace avg time jumps to 1-10s. It happens 1-2 times per hour. – jnr Oct 25 '18 at 12:57
  • https://imgur.com/a/b7UAmOR on first chart is avg time and second metaspace size. As you can see without working gc avg time is growing. – jnr Oct 25 '18 at 13:04