Skip to content

GC Algorithms Java Versions

Rajendra Prasad Reddy Penumalli edited this page Jun 29, 2020 · 5 revisions

Performance goals in regards of Garbage Collection:

  1. Latency
  2. Throughput
  3. Capacity

Three basic algorithms:

  1. Mark-sweep
  2. Mark-sweep-compact
  3. Mark-copy

G1-GC Parameters / Tuning

  • We need to explicitly enable G1 GC in Java 8
    • Explicitly set G1 GC in Java 8 if heap > 4G , from Java 9 onward its default
    • Flag to enable in Java 8: -XX:+UseG1GC (Enables G1GC algorithm)
    • -XX:MaxGCPauseMillis=2000 ( Recommended between 500-2000 ms )
    • -XX:+UseStringDeduplication
    • After Observing the G1 GC logs one can suggest new parameter that might help in efficient memory utilization.
Clone this wiki locally