Successfully reported this slideshow.
Your SlideShare is downloading. ×

G1: To Infinity and Beyond

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 25 Ad

G1: To Infinity and Beyond

Download to read offline

G1 has been around for quite some time now and since JDK 9 it is the default garbage collector in OpenJDK. The community working on G1 is big and the contributions over the last few years have made a significant impact on the overall performance. This talk will focus on some of these features and how they have improved G1 in various ways, including smaller memory footprint and shorter P99 pause times. We will also take a brief look at what features we have lined up for the future.

G1 has been around for quite some time now and since JDK 9 it is the default garbage collector in OpenJDK. The community working on G1 is big and the contributions over the last few years have made a significant impact on the overall performance. This talk will focus on some of these features and how they have improved G1 in various ways, including smaller memory footprint and shorter P99 pause times. We will also take a brief look at what features we have lined up for the future.

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

More from ScyllaDB (20)

Advertisement

Recently uploaded (20)

G1: To Infinity and Beyond

  1. 1. Brought to you by G1: To Infinity and Beyond Stefan Johansson OpenJDK GC Engineer, Oracle
  2. 2. Copyright © 2021 Oracle and/or its affiliates. Agenda ■ GC in OpenJDK ■ Short intro to G1 ■ Progress since JDK 8 ■ The future
  3. 3. Copyright © 2021 Oracle and/or its affiliates. GC in OpenJDK
  4. 4. Copyright © 2021 Oracle and/or its affiliates. Introduction GC in OpenJDK ● Fast allocation ● Efficient reclamation ● Serving different use cases
  5. 5. Copyright © 2021 Oracle and/or its affiliates. Strategies GC in OpenJDK ● Tracing the object graph ● Stop-the-world or concurrent ● Generational collections
  6. 6. Copyright © 2021 Oracle and/or its affiliates. Focus and tradeoffs GC in OpenJDK ● Throughput ● Latency ● Footprint
  7. 7. Copyright © 2021 Oracle and/or its affiliates. Current Collectors GC in OpenJDK Collector name Focus area Concepts Serial Memory footprint Generational, single threaded STW collections Parallel Throughput Generational, multi-threaded STW collections G1 Balanced performance Generational, STW collections, concurrent marking ZGC Low latency Concurrent collections Shenandoah Low latency Concurrent collections
  8. 8. Copyright © 2021 Oracle and/or its affiliates. Short intro to G1
  9. 9. Copyright © 2021 Oracle and/or its affiliates. Basic idea Short intro to G1 ● Balance between throughput and latency ● Region based ● Concurrent marking ● Mixed collections ● Main tuning knob: pause-time goal
  10. 10. Copyright © 2021 Oracle and/or its affiliates. Current status Short intro to G1 ● Supported since JDK 7u4 ● Stable and mature ● Default collector since JDK 9 ● Actively maintained and improved
  11. 11. Copyright © 2021 Oracle and/or its affiliates. Progress since JDK 8
  12. 12. Copyright © 2021 Oracle and/or its affiliates. Overview Progress since JDK 8 ● 1000+ enhancements since JDK 8 ● Significant improvements ● Across all areas ● Cut away old tradeoffs
  13. 13. Copyright © 2021 Oracle and/or its affiliates. Throughput Progress since JDK 8 ● Improved NUMA awareness ● More efficient concurrent work ● Parallel Full Collection
  14. 14. Copyright © 2021 Oracle and/or its affiliates. Throughput Progress since JDK 8 ● SPECjbb® 2015 results ● 16 GB heap ● Not only GC improvements ● More time spent running Java SPEC® and the benchmark name SPECjbb® are registered trademarks of the Standard Performance Evaluation Corporation. For more information about SPECjbb, see www.spec.org/jbb2015/.
  15. 15. Copyright © 2021 Oracle and/or its affiliates. Latency Progress since JDK 8 ● Improved parallelism ● More efficient processing ● Better pause time predictions ● Abortable mixed collections
  16. 16. Copyright © 2021 Oracle and/or its affiliates. Latency Progress since JDK 8 ● SPECjbb® 2015 results ● 16 GB heap ● Mostly GC improvements ● Trade throughput for latency SPEC® and the benchmark name SPECjbb® are registered trademarks of the Standard Performance Evaluation Corporation. For more information about SPECjbb, see www.spec.org/jbb2015/.
  17. 17. Copyright © 2021 Oracle and/or its affiliates. Latency Progress since JDK 8 ● SPECjbb® 2015 fixed load ● 16 GB heap ● Pause times JDK 8 JDK 11 JDK 17 Average (ms) 154 98 84 P99 (ms) 186 126 111
  18. 18. Copyright © 2021 Oracle and/or its affiliates. Latency Progress since JDK 8 ● SPECjbb® 2015 fixed load ● 16 GB heap ● Pause times JDK 8 JDK 11 JDK 17 JDK 17 50ms Average (ms) 154 98 84 47 P99 (ms) 186 126 111 60
  19. 19. Copyright © 2021 Oracle and/or its affiliates. Latency Progress since JDK 8 ● Bonus slide: ZGC ● Sub-millisecond pause goal ● All heavy work done concurrently JDK 8 JDK 11 JDK 17 JDK 17 ZGC Average (ms) 154 98 84 0.029 P99 (ms) 186 126 111 0.186
  20. 20. Copyright © 2021 Oracle and/or its affiliates. Footprint Progress since JDK 8 ● Rebuilding remembered sets concurrently ● Improved remembered set ergonomics ● Return heap memory to the OS
  21. 21. Copyright © 2021 Oracle and/or its affiliates. Footprint Progress since JDK 8 ● BigRamTester ● 16GB heap
  22. 22. Copyright © 2021 Oracle and/or its affiliates. The future
  23. 23. Copyright © 2021 Oracle and/or its affiliates. Keep improving The future ● Usability improvements ● Improved write barriers ● Footprint reductions
  24. 24. Copyright © 2021 Oracle and/or its affiliates. Key takeaways To Infinity and Beyond ● Massive improvements since JDK 8 ● Exciting features in the pipe
  25. 25. Copyright © 2021 Oracle and/or its affiliates. Brought to you by Stefan Johansson Twitter: @kstefanj Blog: kstefanj.github.io

×