Generated by GPT-5-mini| ZGC | |
|---|---|
| Name | ZGC |
| Developer | Oracle Corporation |
| Released | 2018 |
| Programming language | Java (programming language) |
| Operating system | Linux, Windows, macOS |
| License | Proprietary software |
ZGC is a low-latency, concurrent garbage collector introduced by Oracle Corporation for the Java SE runtime. Designed to minimize pause times in large-heap deployments, it targets applications running on modern multicore servers and cloud platforms such as Amazon Web Services, Google Cloud Platform, and Microsoft Azure. ZGC has been discussed in venues including the JavaOne conference, the ACM SIGPLAN community, and publications by engineers from Oracle Labs and the OpenJDK project.
ZGC originated within Oracle Corporation research efforts to address latency challenges encountered by users of the HotSpot Virtual Machine in production services like Oracle Cloud Infrastructure. Early prototypes were presented alongside other advanced collectors such as G1 garbage collector and Shenandoah (garbage collector), with implementation work appearing in the OpenJDK repositories. ZGC entered experimental status in JDK 11 and progressed through staged integration in JDK 12, JDK 13, and later releases, with production readiness emphasized by teams working on Java Development Kit releases and contributors from Red Hat and IBM. The design decisions were informed by field experience from large-scale systems operated by companies like LinkedIn, Twitter, Netflix, and Airbnb.
ZGC's architecture centers on concurrent, region-based memory management that separates marking, relocation, and remapping phases. It uses a multi-region heap layout reminiscent of ideas explored in collectors such as Metronome (garbage collector) and Immix (garbage collector), combined with colored pointer techniques similar to those investigated by researchers at University of Cambridge and MIT. The collector employs load barriers and colored pointers encoded within pointer bits, leveraging virtual memory tricks available on x86-64 and AArch64 platforms. ZGC integrates with the HotSpot VM's runtime services like the Just-In-Time compiler and the Garbage-First collector's ergonomics while maintaining compatibility with Java Native Interface and Java Virtual Machine Tool Interface hooks used by monitoring tools from AppDynamics, New Relic, and Datadog.
ZGC performs most of its work concurrently with application threads, using algorithms for concurrent marking, concurrent relocation, and on-the-fly pointer remapping. It relies on page-table style mapping and a load barrier similar in spirit to techniques from Anthony Hosking and research groups at Northeastern University and University of Massachusetts Amherst. The collector's relocation uses a forwarding approach where objects are moved and the original references are updated via a remapping stage that avoids stop-the-world compaction. ZGC's heuristics for liveness tracing interface with the HotSpot service thread model and coordinate with safepoints only for brief operations such as epoch advances. The algorithmic choices echo work in concurrent compaction explored at IBM Research and in academic papers presented at PLDI and ISMM conferences.
ZGC targets sub-millisecond pause times even with multi-terabyte heaps, addressing latency-sensitive services at companies like Facebook, Uber, and Spotify. Benchmarks compare ZGC against collectors such as Concurrent Mark Sweep (CMS) and G1 using workloads from the SPECjbb suite, microbenchmarks from the DaCapo suite, and production traces from web services including Etsy and Pinterest. On modern NUMA hardware and many-core instances offered by Amazon EC2 or Google Compute Engine, ZGC scales with additional CPU cores and benefits from large virtual memory address spaces provided by 64-bit platforms. Trade-offs include increased CPU overhead for barrier operations, which has prompted comparisons to Shenandoah and tuning guidance issued by vendors like Oracle and Red Hat.
ZGC is enabled via JVM flags documented in (JEP) discussions and OpenJDK issue trackers; common options include enabling the collector and tuning heap sizing with flags such as -Xms and -Xmx. Administrators and SREs operating services on Kubernetes or Docker often combine ZGC settings with container memory limits and monitoring tools from Prometheus and Grafana. Because ZGC leverages virtual memory tricks, compatibility considerations exist for operating systems like FreeBSD and kernel configurations used in CoreOS or Red Hat Enterprise Linux. Performance tuning focuses on heap sizing, thread counts, and NUMA allocation policies; operators consult guidance from Oracle JVM Tuning Guide and community posts by teams at Twitter Engineering and Netflix TechBlog.
ZGC is adopted in latency-critical environments such as high-frequency trading firms, real-time analytics platforms, and large-scale microservices architectures employed by companies like Goldman Sachs, Bloomberg L.P., and Capital One. Cloud-native Java applications orchestrated on Kubernetes clusters use ZGC to reduce GC-induced latency spikes while running services implemented with Spring Framework, Micronaut, or Quarkus. Open-source projects and enterprise vendors have integrated ZGC support into CI pipelines and observability stacks, with contributions from organizations including Red Hat, IBM, Amazon Corretto, and the AdoptOpenJDK community.
Category:Java virtual machine components