Garbage Collection

  • Java Garbage Collection Distilled: From the mechanical sympathy blog, a 2013 post that is out of date in terms of what GC algorithms are out there these days but discusses the issues well:
    • Stop the world pauses
    • Safe points are spots in a program where threads can pause and memory will be in a consistent state. (at the tails of loops, methods, etc.) GCs will force all threads to stop here during a gcs, (minor and full usually need to do this) the more threads there are in an app the longer this takes
    • Heap organization for the major collectors that existed at the time. eg ParallelGC uses a small number of regions - young, survivor x n, tenured and G1 uses small, equal sized regions of memory
    • Tunables related to gc management
    • How to monitor management of gc in a system: Visual vm does look neat!

Native memory usage

Native memory usage

ZGC pause times vs G1

ZGC pause times vs G1