I have:
- the application multi thread, low latency
- OpenJDK 64-Bit Server VM version 11.0.7+10
- configuration is Xms=6g Xmx=12g
- machine is 12CPU
- started in GCP (Google Cloud Platform) in Kubernetes
Problem is:
- when I migrate from java8 to java11 I observe situation: the application consume much more CPU and memory then the same application with java8. I suspect GC. because when i use ParallelGC (deprecated) everything looks better (more stable)
-XX:+UseParallelGC -Xmx12g -Xms6g -XX:ParallelGCThreads=23
than when I use G1GC (recommended):
-XX:+UseG1GC -Xmx12g -Xms6g -XX:ParallelGCThreads=23 -XX:ConcGCThreads=4
as far as I see response time and number of processed messages are similar (or almost the same). JConsole say ParallelGC spend much more time in GC than G1GC.
The question is: how to reduce CPU usage with G1GC(?) on GCP Kubernetes
Maybe it is not an issue with GC - maybe it is something else - any avdice?
Here you can see stats from JConsole - on left site is ParallelGC on right site is G1GC
(watch CPU usage - this is the same application - traffic is similar ParallelGC processed 22k messages vs 18k messages for G1GC)