SlideShare a Scribd company logo
1 of 44
Z Garbage Collector –
Look Ma ~No Pause!
- Monica Beckwith
- @mon_beck
Agenda  The Basic Principles of an Adaptive,
Predictable Garbage Collector
 Designing a GC
 Introduction to Z Garbage Collector
 Design Considerations
 Phases
 Production Readiness
 Performance Impact and Considerations
 Comparison with G1 GC
The Basic Principles of an Adaptive,
Predictable Garbage Collector
OpenJDK HotSpot collectors are designed with different optimization
goals that lead to different algorithmic considerations.
• E.g., a generational collector helps with scaling and maximizing
throughput
• Having multiple GC threads working in parallel helps speed up the time
it takes to complete the GC work
Designing a Garbage Collector (GC)
Let’s Design a GC
GC
Generational Parallel Work
Young Old
Stop-the-
World Threads
Concurrent
Threads
Maintenance Barriers Maintenance Barriers
The goal is to avoid fragmentation and to not take resources
away from the application:
• The work of marking and compaction can be done in a single
stop-the-world (STW) pause/collection known as the Full GC.
• Avoid concurrent work as that may take resources away from
the application threads.
Designing a Throughput Maximizing GC
Let’s Design a Throughput Maximizing GC
Generational Parallel Work
Young Old
Stop-the-
World Threads
Concurrent
Threads
Maintenance Barriers Maintenance Barriers
GC
Throughput Maximizer
A full compacting GC:
• Can get unpredictable and cause stalls that can cause you to miss delivering on your
system level objectives!
• May not scale well when your application has higher promotion rates with lots of
transients
In-order to be able to scale well and add some predictability, we need to
add:
• Regionalized heap &
• Partial compaction with concurrent marking
But I Can’t Deal With Those Long Pauses
Latency Sensitive
Generational Parallel Work
Partial
Compaction
Concurrent
Marking
Let’s Design a Latency Sensitive GC
Regionalized Heap
Young Old
Maintenance Barriers Maintenance Barriers
So, you need a predictable, scalable, low-latency GC?
• Keep the partial compaction, but make it concurrent
• Set time budgets on the STW phases
• Fall back to concurrent work once time budget is exceeded
• Repeat incremental concurrent work and time budgeted STW phases until work is
done.
• Elicit application threads to help with concurrent compaction aka relocation work – this
is known as ‘self-healing’
But I Can’t Deal With Those Long Pauses Tail Latencies
Low-Latency Sensitive
Generational Parallel Work
Let’s Design a Low-Latency Sensitive GC
Regionalized Heap
Partial/Incremental
Concurrent
Marking
Compaction
Self Healing
Young Old
Maintenance Barriers
Maintenance Barriers
Generational
Young Old
Maintenance Barriers
Z GC
Not There
Yet
Introduction to Z Garbage Collector
Design Considerations
ZGC is an adaptive, near-real-time, scalable, predictable low-latency
collector
• It can guarantee sub milliseconds pause times
• The GC pause doesn’t increase with the application heap, live dataset or
the root set sizes
• It can span heap sizes from 8MBs up to 16TBs!
• It works concurrently with your application and strives to not let the
application throughput fall below 15%!
Z GC Design Goals
Z GC Core Concept – Colored Pointers
http://cr.openjdk.java.net/~pliden/slides/ZGC-Jfokus-2018.pdf
Object Address
0
43
Unused
M
a
r
k
e
d
0
M
a
r
k
e
d
1
R
e
m
a
p
p
e
d
F
i
n
a
l
i
z
a
b
l
e
48
63
Object is known to
be marked?
Object is known to
not be pointing into
the relocation set?
Object is reachable
only through a
Finalizer?
Metadata stores in the unused bits of the 64-bit pointers
Virtual address mapping/tagging
Multi-mapping on x86-64, aarch64
Introduction to Z Garbage Collector
Phases
GC Background Threads
Z GC Phases
Java Application Threads
Pause
Mark
Start
Pause
Mark
End
Pause
Relocate
Start
Concurrent
Mark/Remap
Concurrent
Relocate
Concurrent Prepare for
Relocation
GC Background Threads
Concurrent Marking
http://cr.openjdk.java.net/~pliden/slides/ZGC-Jfokus-2018.pdf
Heap
GC
Thread 0
GC
Thread 1
GC
Thread n
…
0 1 … n 0 1 … n 0 1 … n
Stripe 0 Stripe 1 Stripe n
• Heap divided into logical stripes
• GC threads work on their own stripe
• Minimizes shared state
• Load barrier to detect loads of non-marked object pointers
• Concurrent reference processing
• Thread local handshakes
Barriers – Loaded Reference Barrier
• Update a “bad” reference to a “good” reference
• Can be self-healing/repairing barrier when updating the source memory
location
• Imposes a set of invariants –
• “All visible loaded reference values will be safely “marked through” by the
collector, if they haven’t been already.
• All visible loaded reference values point to the current location of the
safely accessible contents of the target objects they refer to.”
Tene, G.; Iyengar, B. & Wolf, M. (2011), C4: The Continuously Concurrent Compacting Collector, in 'Proceedings
of the international symposium on Memory management' , ACM, New York, NY, USA , pp. 79--88 .
Concurrent Compaction
 Load barrier to detect object pointers into the collection set
 Can be self-healing
 Off-heap forwarding tables enable to immediately release and reuse
virtual and physical memory
http://cr.openjdk.java.net/~pliden/slides/ZGC-Jfokus-2018.pdf
Introduction to Z Garbage Collector
Production Readiness
In-order to provide more near-real-time control over the pauses, Z GC has provided many
improvements to OpenJDK HotSpot. Here’s a list of few of the optimizations:
• Thread local handshakes – JDK 10
• Load barriers and colored pointers – JDK 11
• Concurrent reference processing – JDK 11
• Concurrent class unloading – JDK 12
• Uncommit unused memory – JDK 13
• Windows and macOS support; Parallel PreTouch – JDK 14
• Compressed class pointers – JDK 15
• Concurrent Thread Stack Scanning – JDK 16
• Extended AArch64 support – JDK 16 (Windows), JDK 17 (macOS)
Z GC Is Production Ready in JDK 15
Thread Local Handshakes vs Global STW
Application Threads Application Threads
Safepoint
Requested
GC
Completed
Application Threads GC Threads Application Threads
Safepoint
Requested
GC
Completed
Handshakes
Time To Safepoint
(TTSP)
GC Threads
Performance Impact and Considerations
Comparison with G1 GC
Effects of Severe Fragmentation
Due to large LDS, varying object sizes and 1 GB/s allocation rates
System: Arm64 running Linux
JDK version: JDK 16 EA (build 16+35-2229)
Benchmark: HeapFragger
Heap Size: 200Gs (initial and max)
LDS: 100Gs
GCs Tested: ZGC and G1GC
Additional JVM Arguments: -XX:+UseLargePages -XX:+AlwaysPreTouch
Benchmark Allocation Rates: 1GB/s
Object Sizes: min: 128B; max: 32.00032MBs
Test Configuration
A Quick Look: Allocation Rate and Promotions
Allocation Rate Promotions
Graceful Degradation: ZGC with Severe Fragmentation
Stalls Observed By The
Application
Worst Case GC Pause
Time = ~0.55ms
Application Latency : G1 GC vs Z GC @1GB/s Allocation Rate
16GB/s
G1 GC
Z GC
Effects of Large Object Sizes and Higher
Allocation Rates (with 50% LDS Pressure)
System: Arm64 running Linux
JDK version: JDK 17 GA (build 17+35)
Benchmark: HyperAlloc
Heap Size: 80Gs (initial and max)
LDS: 40Gs
Benchmark Threads: 80
GCs Tested: ZGC and G1GC
Additional JVM Arguments: -XX:+UseLargePages -XX:+AlwaysPreTouch
Benchmark Allocation Rates: 4GB/s, 8GB/s, 16GB/s
Object Sizes: min: 128B; max: 32.00032MBs (humongous objects)
Test Configuration
Under Pressure : High Allocation Rate, Short-Lived Objects
Live At Mark Start Live At Relocation End
Reasons For Triggering a GC Cycle
Cause Name Description
Timer When timer is up and if no other GC has been performed
yet.
Warmup Based on heap occupancy and if no other GC has been
performed yet.
Allocation Rate Based on high allocation rates and possibility to run out
of heap space
Allocation Stall Mutator blocked due to lack of heap space
Proactive To maintain lower heap sizes if occupancy increases by
10% since the last GC or 5 minutes have passes since.
High
Utilization
Avoid GC due to ‘Allocation Rate’ trigger by
preventatively trigger GC if heap is 95% occupied and
application has a low allocation rate
Count
Timer Warmup
Allocation Rate Allocation Stall
Proactive High Utilization
Very High Allocation Rates and Effects on ZGC
Worst Case Pause Time
Very High Allocation Rates and Effects on Application
A Quick Comparison With G1
GC Pause Times Latency Observed by Application
Application Latencies Comparison Between G1GC and ZGC
Effects of Large Object Sizes and Higher
Allocation Rates (with 50% LDS & 25% MDS
Pressure)
System: Arm64 running Linux
JDK version: JDK 17 GA (build 17+35)
Benchmark: HyperAlloc
Heap Size: 80Gs (initial and max)
LDS: 40Gs
MDS: 20Gs
Benchmark Threads: 80
GCs Tested: ZGC and G1GC
Additional JVM Arguments: -XX:+UseLargePages -XX:+AlwaysPreTouch
Benchmark Allocation Rates: 4GB/s, 8GB/s, 16GB/s
Object Sizes: min: 128B; max: 32.00032MBs (humongous objects)
Test Configuration
Under Pressure : High Allocation Rate, Medium-Lived Objects
Live At Mark Start Live At Relocation End
Reasons For Triggering a GC Cycle
Cause Name Description
Timer When timer is up and if no other GC has been performed
yet.
Warmup Based on heap occupancy and if no other GC has been
performed yet.
Allocation Rate Based on high allocation rates and possibility to run out
of heap space
Allocation Stall Mutator blocked due to lack of heap space
Proactive To maintain lower heap sizes if occupancy increases by
10% since the last GC or 5 minutes have passes since.
High
Utilization
Avoid GC due to ‘Allocation Rate’ trigger by
preventatively trigger GC if heap is 95% occupied and
application has a low allocation rate
Count
Timer Warmup
Allocation Rate Allocation Stall
Proactive High Utilization
Very High Allocation Rate and Effects on ZGC
Worst Case Pause Time
Allocation Stalls and Effects on Application
A Quick Comparison With G1
Latency Observed by Application
GC Pause Times
© Copyright Microsoft Corporation. All rights reserved.
https://wiki.openjdk.java.net/display/zgc/Main
https://malloc.se/blog/zgc-jdk15
http://cr.openjdk.java.net/~pliden/slides/ZGC-OracleDevLive-2020.pdf
Tools:
Censum and some parsing scripts and JFreeChart + GCHisto
jHiccup: https://support.azul.com/hc/en-us/articles/217877803-How-to-Analyze-and-
Visualize-jHiccup-Logs
HistogramLogAnalyzer: https://github.com/HdrHistogram/HistogramLogAnalyzer
Thank You!

More Related Content

Similar to ZGC-SnowOne.pdf

Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionHaribabu Nandyal Padmanaban
 
Java at Scale, Dallas JUG, October 2013
Java at Scale, Dallas JUG, October 2013Java at Scale, Dallas JUG, October 2013
Java at Scale, Dallas JUG, October 2013Azul Systems Inc.
 
Gopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowGopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowMateuszSzczyrzyca
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Monica Beckwith
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Anna Shymchenko
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance TuningJeremy Leisy
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展Leon Chen
 
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBaseHBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBaseHBaseCon
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsIsuru Perera
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareIndicThreads
 
this-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxthis-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxTier1 app
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...Jelastic Multi-Cloud PaaS
 
Garbage collection
Garbage collectionGarbage collection
Garbage collectionMudit Gupta
 
Implementing data and databases on K8s within the Dutch government
Implementing data and databases on K8s within the Dutch governmentImplementing data and databases on K8s within the Dutch government
Implementing data and databases on K8s within the Dutch governmentDoKC
 
DevoxxUK: Optimizating Application Performance on Kubernetes
DevoxxUK: Optimizating Application Performance on KubernetesDevoxxUK: Optimizating Application Performance on Kubernetes
DevoxxUK: Optimizating Application Performance on KubernetesDinakar Guniguntala
 
An introduction to G1 collector for busy developers
An introduction to G1 collector for busy developersAn introduction to G1 collector for busy developers
An introduction to G1 collector for busy developersSanjoy Kumar Roy
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaIsuru Perera
 

Similar to ZGC-SnowOne.pdf (20)

Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
 
Java at Scale, Dallas JUG, October 2013
Java at Scale, Dallas JUG, October 2013Java at Scale, Dallas JUG, October 2013
Java at Scale, Dallas JUG, October 2013
 
Gopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowGopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracow
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展
 
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBaseHBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and Flamegraphs
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardware
 
this-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxthis-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptx
 
Gc Easy
Gc EasyGc Easy
Gc Easy
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Implementing data and databases on K8s within the Dutch government
Implementing data and databases on K8s within the Dutch governmentImplementing data and databases on K8s within the Dutch government
Implementing data and databases on K8s within the Dutch government
 
DevoxxUK: Optimizating Application Performance on Kubernetes
DevoxxUK: Optimizating Application Performance on KubernetesDevoxxUK: Optimizating Application Performance on Kubernetes
DevoxxUK: Optimizating Application Performance on Kubernetes
 
An introduction to G1 collector for busy developers
An introduction to G1 collector for busy developersAn introduction to G1 collector for busy developers
An introduction to G1 collector for busy developers
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in Java
 

More from Monica Beckwith

The ilities of software engineering.pptx
The ilities of software engineering.pptxThe ilities of software engineering.pptx
The ilities of software engineering.pptxMonica Beckwith
 
Enabling Java: Windows on Arm64 - A Success Story!
Enabling Java: Windows on Arm64 - A Success Story!Enabling Java: Windows on Arm64 - A Success Story!
Enabling Java: Windows on Arm64 - A Success Story!Monica Beckwith
 
Applying Concurrency Cookbook Recipes to SPEC JBB
Applying Concurrency Cookbook Recipes to SPEC JBBApplying Concurrency Cookbook Recipes to SPEC JBB
Applying Concurrency Cookbook Recipes to SPEC JBBMonica Beckwith
 
Intro to Garbage Collection
Intro to Garbage CollectionIntro to Garbage Collection
Intro to Garbage CollectionMonica Beckwith
 
OpenJDK Concurrent Collectors
OpenJDK Concurrent CollectorsOpenJDK Concurrent Collectors
OpenJDK Concurrent CollectorsMonica Beckwith
 
OPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORS
OPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORSOPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORS
OPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORSMonica Beckwith
 
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
The Performance Engineer's Guide to Java (HotSpot) Virtual MachineThe Performance Engineer's Guide to Java (HotSpot) Virtual Machine
The Performance Engineer's Guide to Java (HotSpot) Virtual MachineMonica Beckwith
 
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Monica Beckwith
 
JFokus Java 9 contended locking performance
JFokus Java 9 contended locking performanceJFokus Java 9 contended locking performance
JFokus Java 9 contended locking performanceMonica Beckwith
 
Java Performance Engineer's Survival Guide
Java Performance Engineer's Survival GuideJava Performance Engineer's Survival Guide
Java Performance Engineer's Survival GuideMonica Beckwith
 
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...Monica Beckwith
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationMonica Beckwith
 
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Monica Beckwith
 
Game of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GCGame of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GCMonica Beckwith
 
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Way Improved :) GC Tuning Confessions - presented at JavaOne2015Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Way Improved :) GC Tuning Confessions - presented at JavaOne2015Monica Beckwith
 
GC Tuning Confessions Of A Performance Engineer - Improved :)
GC Tuning Confessions Of A Performance Engineer - Improved :)GC Tuning Confessions Of A Performance Engineer - Improved :)
GC Tuning Confessions Of A Performance Engineer - Improved :)Monica Beckwith
 
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...Monica Beckwith
 

More from Monica Beckwith (19)

The ilities of software engineering.pptx
The ilities of software engineering.pptxThe ilities of software engineering.pptx
The ilities of software engineering.pptx
 
A G1GC Saga-KCJUG.pptx
A G1GC Saga-KCJUG.pptxA G1GC Saga-KCJUG.pptx
A G1GC Saga-KCJUG.pptx
 
QCon London.pdf
QCon London.pdfQCon London.pdf
QCon London.pdf
 
Enabling Java: Windows on Arm64 - A Success Story!
Enabling Java: Windows on Arm64 - A Success Story!Enabling Java: Windows on Arm64 - A Success Story!
Enabling Java: Windows on Arm64 - A Success Story!
 
Applying Concurrency Cookbook Recipes to SPEC JBB
Applying Concurrency Cookbook Recipes to SPEC JBBApplying Concurrency Cookbook Recipes to SPEC JBB
Applying Concurrency Cookbook Recipes to SPEC JBB
 
Intro to Garbage Collection
Intro to Garbage CollectionIntro to Garbage Collection
Intro to Garbage Collection
 
OpenJDK Concurrent Collectors
OpenJDK Concurrent CollectorsOpenJDK Concurrent Collectors
OpenJDK Concurrent Collectors
 
OPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORS
OPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORSOPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORS
OPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORS
 
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
The Performance Engineer's Guide to Java (HotSpot) Virtual MachineThe Performance Engineer's Guide to Java (HotSpot) Virtual Machine
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
 
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!
 
JFokus Java 9 contended locking performance
JFokus Java 9 contended locking performanceJFokus Java 9 contended locking performance
JFokus Java 9 contended locking performance
 
Java Performance Engineer's Survival Guide
Java Performance Engineer's Survival GuideJava Performance Engineer's Survival Guide
Java Performance Engineer's Survival Guide
 
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
 
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!
 
Game of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GCGame of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GC
 
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Way Improved :) GC Tuning Confessions - presented at JavaOne2015Way Improved :) GC Tuning Confessions - presented at JavaOne2015
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
 
GC Tuning Confessions Of A Performance Engineer - Improved :)
GC Tuning Confessions Of A Performance Engineer - Improved :)GC Tuning Confessions Of A Performance Engineer - Improved :)
GC Tuning Confessions Of A Performance Engineer - Improved :)
 
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
 

Recently uploaded

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 

ZGC-SnowOne.pdf

  • 1. Z Garbage Collector – Look Ma ~No Pause! - Monica Beckwith - @mon_beck
  • 2. Agenda  The Basic Principles of an Adaptive, Predictable Garbage Collector  Designing a GC  Introduction to Z Garbage Collector  Design Considerations  Phases  Production Readiness  Performance Impact and Considerations  Comparison with G1 GC
  • 3. The Basic Principles of an Adaptive, Predictable Garbage Collector
  • 4. OpenJDK HotSpot collectors are designed with different optimization goals that lead to different algorithmic considerations. • E.g., a generational collector helps with scaling and maximizing throughput • Having multiple GC threads working in parallel helps speed up the time it takes to complete the GC work Designing a Garbage Collector (GC)
  • 5. Let’s Design a GC GC Generational Parallel Work Young Old Stop-the- World Threads Concurrent Threads Maintenance Barriers Maintenance Barriers
  • 6. The goal is to avoid fragmentation and to not take resources away from the application: • The work of marking and compaction can be done in a single stop-the-world (STW) pause/collection known as the Full GC. • Avoid concurrent work as that may take resources away from the application threads. Designing a Throughput Maximizing GC
  • 7. Let’s Design a Throughput Maximizing GC Generational Parallel Work Young Old Stop-the- World Threads Concurrent Threads Maintenance Barriers Maintenance Barriers GC Throughput Maximizer
  • 8. A full compacting GC: • Can get unpredictable and cause stalls that can cause you to miss delivering on your system level objectives! • May not scale well when your application has higher promotion rates with lots of transients In-order to be able to scale well and add some predictability, we need to add: • Regionalized heap & • Partial compaction with concurrent marking But I Can’t Deal With Those Long Pauses
  • 9. Latency Sensitive Generational Parallel Work Partial Compaction Concurrent Marking Let’s Design a Latency Sensitive GC Regionalized Heap Young Old Maintenance Barriers Maintenance Barriers
  • 10. So, you need a predictable, scalable, low-latency GC? • Keep the partial compaction, but make it concurrent • Set time budgets on the STW phases • Fall back to concurrent work once time budget is exceeded • Repeat incremental concurrent work and time budgeted STW phases until work is done. • Elicit application threads to help with concurrent compaction aka relocation work – this is known as ‘self-healing’ But I Can’t Deal With Those Long Pauses Tail Latencies
  • 11. Low-Latency Sensitive Generational Parallel Work Let’s Design a Low-Latency Sensitive GC Regionalized Heap Partial/Incremental Concurrent Marking Compaction Self Healing Young Old Maintenance Barriers Maintenance Barriers Generational Young Old Maintenance Barriers Z GC Not There Yet
  • 12. Introduction to Z Garbage Collector Design Considerations
  • 13. ZGC is an adaptive, near-real-time, scalable, predictable low-latency collector • It can guarantee sub milliseconds pause times • The GC pause doesn’t increase with the application heap, live dataset or the root set sizes • It can span heap sizes from 8MBs up to 16TBs! • It works concurrently with your application and strives to not let the application throughput fall below 15%! Z GC Design Goals
  • 14. Z GC Core Concept – Colored Pointers http://cr.openjdk.java.net/~pliden/slides/ZGC-Jfokus-2018.pdf Object Address 0 43 Unused M a r k e d 0 M a r k e d 1 R e m a p p e d F i n a l i z a b l e 48 63 Object is known to be marked? Object is known to not be pointing into the relocation set? Object is reachable only through a Finalizer? Metadata stores in the unused bits of the 64-bit pointers Virtual address mapping/tagging Multi-mapping on x86-64, aarch64
  • 15. Introduction to Z Garbage Collector Phases
  • 16. GC Background Threads Z GC Phases Java Application Threads Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Mark/Remap Concurrent Relocate Concurrent Prepare for Relocation GC Background Threads
  • 17. Concurrent Marking http://cr.openjdk.java.net/~pliden/slides/ZGC-Jfokus-2018.pdf Heap GC Thread 0 GC Thread 1 GC Thread n … 0 1 … n 0 1 … n 0 1 … n Stripe 0 Stripe 1 Stripe n • Heap divided into logical stripes • GC threads work on their own stripe • Minimizes shared state • Load barrier to detect loads of non-marked object pointers • Concurrent reference processing • Thread local handshakes
  • 18. Barriers – Loaded Reference Barrier • Update a “bad” reference to a “good” reference • Can be self-healing/repairing barrier when updating the source memory location • Imposes a set of invariants – • “All visible loaded reference values will be safely “marked through” by the collector, if they haven’t been already. • All visible loaded reference values point to the current location of the safely accessible contents of the target objects they refer to.” Tene, G.; Iyengar, B. & Wolf, M. (2011), C4: The Continuously Concurrent Compacting Collector, in 'Proceedings of the international symposium on Memory management' , ACM, New York, NY, USA , pp. 79--88 .
  • 19. Concurrent Compaction  Load barrier to detect object pointers into the collection set  Can be self-healing  Off-heap forwarding tables enable to immediately release and reuse virtual and physical memory http://cr.openjdk.java.net/~pliden/slides/ZGC-Jfokus-2018.pdf
  • 20. Introduction to Z Garbage Collector Production Readiness
  • 21. In-order to provide more near-real-time control over the pauses, Z GC has provided many improvements to OpenJDK HotSpot. Here’s a list of few of the optimizations: • Thread local handshakes – JDK 10 • Load barriers and colored pointers – JDK 11 • Concurrent reference processing – JDK 11 • Concurrent class unloading – JDK 12 • Uncommit unused memory – JDK 13 • Windows and macOS support; Parallel PreTouch – JDK 14 • Compressed class pointers – JDK 15 • Concurrent Thread Stack Scanning – JDK 16 • Extended AArch64 support – JDK 16 (Windows), JDK 17 (macOS) Z GC Is Production Ready in JDK 15
  • 22. Thread Local Handshakes vs Global STW Application Threads Application Threads Safepoint Requested GC Completed Application Threads GC Threads Application Threads Safepoint Requested GC Completed Handshakes Time To Safepoint (TTSP) GC Threads
  • 23. Performance Impact and Considerations Comparison with G1 GC
  • 24. Effects of Severe Fragmentation Due to large LDS, varying object sizes and 1 GB/s allocation rates
  • 25. System: Arm64 running Linux JDK version: JDK 16 EA (build 16+35-2229) Benchmark: HeapFragger Heap Size: 200Gs (initial and max) LDS: 100Gs GCs Tested: ZGC and G1GC Additional JVM Arguments: -XX:+UseLargePages -XX:+AlwaysPreTouch Benchmark Allocation Rates: 1GB/s Object Sizes: min: 128B; max: 32.00032MBs Test Configuration
  • 26. A Quick Look: Allocation Rate and Promotions Allocation Rate Promotions
  • 27. Graceful Degradation: ZGC with Severe Fragmentation Stalls Observed By The Application Worst Case GC Pause Time = ~0.55ms
  • 28. Application Latency : G1 GC vs Z GC @1GB/s Allocation Rate 16GB/s G1 GC Z GC
  • 29. Effects of Large Object Sizes and Higher Allocation Rates (with 50% LDS Pressure)
  • 30. System: Arm64 running Linux JDK version: JDK 17 GA (build 17+35) Benchmark: HyperAlloc Heap Size: 80Gs (initial and max) LDS: 40Gs Benchmark Threads: 80 GCs Tested: ZGC and G1GC Additional JVM Arguments: -XX:+UseLargePages -XX:+AlwaysPreTouch Benchmark Allocation Rates: 4GB/s, 8GB/s, 16GB/s Object Sizes: min: 128B; max: 32.00032MBs (humongous objects) Test Configuration
  • 31. Under Pressure : High Allocation Rate, Short-Lived Objects Live At Mark Start Live At Relocation End
  • 32. Reasons For Triggering a GC Cycle Cause Name Description Timer When timer is up and if no other GC has been performed yet. Warmup Based on heap occupancy and if no other GC has been performed yet. Allocation Rate Based on high allocation rates and possibility to run out of heap space Allocation Stall Mutator blocked due to lack of heap space Proactive To maintain lower heap sizes if occupancy increases by 10% since the last GC or 5 minutes have passes since. High Utilization Avoid GC due to ‘Allocation Rate’ trigger by preventatively trigger GC if heap is 95% occupied and application has a low allocation rate Count Timer Warmup Allocation Rate Allocation Stall Proactive High Utilization
  • 33. Very High Allocation Rates and Effects on ZGC Worst Case Pause Time
  • 34. Very High Allocation Rates and Effects on Application
  • 35. A Quick Comparison With G1 GC Pause Times Latency Observed by Application
  • 36. Application Latencies Comparison Between G1GC and ZGC
  • 37. Effects of Large Object Sizes and Higher Allocation Rates (with 50% LDS & 25% MDS Pressure)
  • 38. System: Arm64 running Linux JDK version: JDK 17 GA (build 17+35) Benchmark: HyperAlloc Heap Size: 80Gs (initial and max) LDS: 40Gs MDS: 20Gs Benchmark Threads: 80 GCs Tested: ZGC and G1GC Additional JVM Arguments: -XX:+UseLargePages -XX:+AlwaysPreTouch Benchmark Allocation Rates: 4GB/s, 8GB/s, 16GB/s Object Sizes: min: 128B; max: 32.00032MBs (humongous objects) Test Configuration
  • 39. Under Pressure : High Allocation Rate, Medium-Lived Objects Live At Mark Start Live At Relocation End
  • 40. Reasons For Triggering a GC Cycle Cause Name Description Timer When timer is up and if no other GC has been performed yet. Warmup Based on heap occupancy and if no other GC has been performed yet. Allocation Rate Based on high allocation rates and possibility to run out of heap space Allocation Stall Mutator blocked due to lack of heap space Proactive To maintain lower heap sizes if occupancy increases by 10% since the last GC or 5 minutes have passes since. High Utilization Avoid GC due to ‘Allocation Rate’ trigger by preventatively trigger GC if heap is 95% occupied and application has a low allocation rate Count Timer Warmup Allocation Rate Allocation Stall Proactive High Utilization
  • 41. Very High Allocation Rate and Effects on ZGC Worst Case Pause Time
  • 42. Allocation Stalls and Effects on Application
  • 43. A Quick Comparison With G1 Latency Observed by Application GC Pause Times
  • 44. © Copyright Microsoft Corporation. All rights reserved. https://wiki.openjdk.java.net/display/zgc/Main https://malloc.se/blog/zgc-jdk15 http://cr.openjdk.java.net/~pliden/slides/ZGC-OracleDevLive-2020.pdf Tools: Censum and some parsing scripts and JFreeChart + GCHisto jHiccup: https://support.azul.com/hc/en-us/articles/217877803-How-to-Analyze-and- Visualize-jHiccup-Logs HistogramLogAnalyzer: https://github.com/HdrHistogram/HistogramLogAnalyzer Thank You!