G1

Garbage First

Introduced in Java 9 to CMS

  • Operation
    • No concept of young and old generations
    • Divides Heap into several memory spaces
    • Collects from region which has most garbage → Garbage first (G1)
  • Advantages
    • GC pauses can be tuned
    • Small pauses
    • Parallelism and concurrency together
    • Better heap utilisation