Our application shows frequent Full GCs after load of about 24 hours. Forcing restarts.
When we analyzed our GC logs, it indicated that the out of 20GB MaxHeap, only 1GB was used for young generation and the 19GB was used by OLD generations.
Command options were -Xms2g -Xmx20g
Should the -Xms2g
be bumped to 10GB or make equal to 20GB so that the NewRatio
default ratio of 2 can let the young generation use larger portion of the JVM?
Monitored the JVM Heap using jmap -histo
and found a pattern when it gives spike in the heap size.
Also tried the GC log analysis using http://gceasy.io
Actually some hibernate entities were getting piled up in the transaction which was an issue in the code.
Got it corrected in the code and it does help keeping the heap under control and not spike it.
On another note, it was observed that though the New-Old ratio was not specified, so the JVM should have used 1:2 ration, but it was not the case. Hence specifically provided values for NewSize and MaxNewSize and it helped getting better results.