Java 21’s ZGC vs Shenandoah GC garbage collectors in a multithreaded test application: An performance evaluation experiment
2025 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [en]
Java's garbage collection systems can significantly influence application performance, especially in memory intensive and multithreaded environments. This study compares the Z Garbage Collector (ZGC) and Shenandoah GC, focusing on their efficiency under one high RAM usage scenario. This paper defines characteristics that a class of programs share and implement these in a custom-built Java 21 benchmark program.
The problem this thesis highlights is towards a class of programs, like High-Frequency Trading (HFT), requiring high throughput and as efficient GC handling as possible. This follows up with the research question basing itself upon the difficulty to choose which of these two GC’s to pick, when a program shares a combination of these predefined characteristics.
Through an experiment methodology with our self-written benchmark program, the research evaluates key metrics such as throughput, latency, and heap utilization. Results indicate that ZGC outperforms Shenandoah GC in a high RAM usage scenario, maintaining optimized heap usage and lower GC pauses. Shenandoah excels in a less memory-intensive medium RAM usage scenario, demonstrating higher throughput. These findings contribute to making informed decisions when selecting suitable GCs based on application requirements, emphasizing energy efficiency and resource optimization. Future research could explore broader real-world implementations and the sustainability implications of GC strategies.
This paper also highlights the role of garbage collector configurations in aligning software performance with hardware capabilities. By selecting GC to specific application demands, developers can achieve more predictable performance, reduced operational costs, and enhanced system longevity. This research highlights the importance of understanding the exchange between latency and throughput. Offering insights into how GC selection can impact application performance but also broader considerations such as RAM consumption and consequently sustainability in large-scale deployments.
Place, publisher, year, edition, pages
2025.
Keywords [en]
Garbage Collection (GC), Java Virtual Machine (JVM), Z Garbage Collector (ZGC), Shenandoah Garbage Collector, Throughput, Latency, GC Pauses, Generational Garbage Collection, Non-Generational Garbage Collection, RAM Allocation, High-Frequency Trading (HFT), Benchmark Program.
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:su:diva-242754OAI: oai:DiVA.org:su-242754DiVA, id: diva2:1955686
2025-04-302025-04-30