Deep Dive into ZGC Memory Allocation: Enhancements with Mapped Cache (JDK-8350441)
2025-04-23
This post delves into the intricacies of Java heap memory allocation in ZGC, an OpenJDK garbage collector. It highlights improvements introduced in JDK-8350441 with the Mapped Cache. ZGC organizes heap memory into pages (Small, Medium, Large) managed by a Page Allocator and partitions. The allocation process is meticulously explained, covering capacity management, the interplay between physical and virtual memory, and the Mapped Cache's role in optimizing allocation speed and reducing fragmentation. The article details NUMA architecture's impact on multi-partition allocation, memory commitment, reclamation, and defragmentation. Finally, it discusses the trade-off between startup time and runtime latency.
Read more
Development
Java Memory Management