Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JavaZone 2019: Garbage Collectors for busy Java developers

Marco Molteni
September 12, 2019

JavaZone 2019: Garbage Collectors for busy Java developers

Which Garbage collectors save you more money in the Cloud? What's the difference between a Serial and a Parallel GC? What is Shenandoah and why is so good? Do you know which GC you are using daily?
A quick visual overview on the Java Garbage collectors, the GC will be explained in plain English without Statistical formulas.

Marco Molteni

September 12, 2019
Tweet

More Decks by Marco Molteni

Other Decks in Programming

Transcript

  1. Marco Molteni

    View Slide

  2. 3 7

    View Slide

  3. Supported Experimental Deprecated (but included)
    G1
    Z
    Shenandoah
    Epsilon
    Non-
    concurrent
    Concurrent
    No-ops
    Java 8
    Serial
    Parallel
    Java 12
    CMS
    4 7

    View Slide

  4. Supported Experimental Deprecated (but included)
    G1
    Z
    Shenandoah
    Epsilon
    Non-
    concurrent
    Concurrent
    No-ops
    Java 8
    Serial
    Parallel
    Java 12
    CMS
    4 3

    View Slide

  5. View Slide

  6. No collector
    satisfies every
    requirement
    Vertically scalable
    High throughput
    Low latency
    Low footprint

    View Slide

  7. View Slide

  8. App Thread App Thread
    GC Thread
    Pause
    GC Thread
    App Thread App Thread App Thread
    Pause Pause

    View Slide

  9. High Throughput
    Low footprint Scalable
    Low latency
    Non-Concurrent
    (Parallel, Serial)
    Concurrent (G1,
    Shenandoah, Z)

    View Slide

  10. View Slide

  11. Parallel
    GC
    App Thread
    GC
    Serial
    App Thread
    Serverless functions.
    Microdevices.
    Batch jobs.

    View Slide

  12. View Slide

  13. Parallel
    Serial
    G1
    Z
    Shenandoah

    View Slide

  14. Java 9
    JEP 248: Make G1 the Default Garbage Collector

    View Slide

  15. Ultra-short pauses (<10 ms).
    Scalable to TB of heap.
    Experimental.

    View Slide

  16. Red Hat Oracle
    Lead
    Platforms
    Production ready
    Platform
    independent
    Linux only
    Java 8u, 11u only
    RedHat builds
    Experimental only

    View Slide

  17. View Slide

  18. Shenandoah G1 & Serial Parallel
    Z (Java 13)
    Allocated Heap
    Used Heap

    View Slide


  19. View Slide

  20. No GC activities.
    Great for tests.
    Epsilon

    View Slide

  21. Man kan ikke få både i pose og sekk
    Garbage Collectors = Tradeoff.
    The best collector is the one that works the well
    for YOUR application, not the one suggested in
    Stack Overflow / benchmarks.

    View Slide