After analyzing the performance issues of an application, following points were noted.
- JVM uses G1 GC
- During peak hours JVM suspension goes beyond 20%
- For Eden Space - GC count per minute is 20 and GC time per minute is 10seconds (not milliseconds)
- For Old Gen space - No GC running. It steadily increases, but also shows some decreases randomly (surprising.)
- CPU usage for Garbage collection is around 7%, where as for the application it is around 30% (including background and web requests)
I tried to collect more details about G1, but still a few questions left unanswered. Please help if you can.
- Is there minor, major or full GC if we use G1? If there is no such classification, why GC is not running for Old Gen? Documentation does not ascertain this.
- Even if GC not running for Old Gen, how does the memory free up even if it is a little? (for example, used memory decreases to 15GB from 16GB and again increases to 16GB)