Java - available garbage collection algorithms

20,753

As of today, there are 4 GC algorithms available in the Java Hotspot VM:

  • The Serial GC - recommended for client-style applications that do not have low pause time requirements.
  • The Parallel GC - use when the throughput matters.
  • The Mostly-Concurrent GC (also known as Concurrent Mark-Sweep GC(CMS)) - use when the latency matters.
  • The Garbage First GC (G1) - new GC algorithm, for CMS replacement.

You can find more information about these GC algorithms in the references below.

Books:

  • Java Performance - practical guide, contains chapters on GC, explains comprehensively when and how to use various Hotspot GC algorithms,
  • The Garbage Collection Handbook - Garbage-Collection theory explained, mentions all available GC techniques.

Talks/Articles:

Mailing List:

Share:
20,753
Bober02
Author by

Bober02

Something will be added here

Updated on March 26, 2020

Comments

  • Bober02
    Bober02 about 4 years

    Does anyone know a proper resource to read on the available garbage collection mechanisms in java? So far I found a couple of websites but they did not contain a comprehensive description with respect to when to use which and what the implementation was. (I am referring to Oracle's jdk)

  • Chamin Wickramarathna
    Chamin Wickramarathna over 6 years
    Then what about Parallel Old GC (Parallel Compacting GC)? Is it an extended version of parallel GC that use in old generation memory?