bhagyac
bhagyac

Reputation: 41

G1GC performance tuning using GC viewer tool

We have a Spring Batch job currently having long running issue in production. On checking GC logs we have found that too many Full GC's occurring frequently. We are using G1GC collector and Java 8 version.

Below are the JVM arguments:

-Xms6g -Xmx20g -XX:NewSize=3g -XX:+UseG1GC -Xloggc:/local/apps/stock.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:-HeapDumpOnOutOfMemoryError

GC log file is analyzed using GCViewer tool, below is the report: enter image description here

enter image description here

enter image description here

GC Pauses:

  1. GC cleanup
  2. GC pause (G1 Evacuation Pause) (mixed)
  3. GC pause (G1 Evacuation Pause) (mixed) (to-space exhausted)
  4. GC pause (G1 Evacuation Pause) (young)
  5. GC pause (G1 Evacuation Pause) (young) (initial-mark)
  6. GC pause (G1 Evacuation Pause) (young) (to-space exhausted)
  7. GC pause (G1 Humongous Allocation) (young)
  8. GC pause (G1 Humongous Allocation) (young) (initial-mark)
  9. GC pause (G1 Humongous Allocation) (young) (to-space exhausted) 10.GC pause (GCLocker Initiated GC) (young)
  10. GC pause (Metadata GC Threshold) (young) (initial-mark)
  11. GC remark;GC ref-proc

Full GC Pauses:

  1. Full GC (Allocation Failure);Eden;Metaspace

Reproducing the Full GC issue in test environment is not possible, so on the basis of report I am trying to resolve this issue. After going through GC log report and various blogs on G1 collector, I am assuming that below GC tuning is required and need to add/modify below parameters.

  1. Remove -XX:NewSize=3g
  2. Add -XX:+DisableExplicitGC to disabled System.gc() calls.
  3. Increase heap size (Xmx) and setting Xms and Xmx to same value.
  4. Add -XX:+UseStringDeduplication -XX:+PrintStringDeduplicationStatistics
  5. Set -XX:MaxGCPauseMillis to high value to maximize the throughput.

Can you suggest if any more parameters need to add and what should be the correct value for these parameters.

Upvotes: 0

Views: 513

Answers (0)

Related Questions