Features of ZGC

Written from scratch, ZGC brings in a lot of features, which have been instrumental in its proposal, design, and implementation.

One of the most outstanding features of ZGC is that it is a concurrent GC. It can mark memory and copy and relocate it, all concurrently. It also has a concurrent reference processor. This essentially means that you can add all sort of references, such as weak references, soft references, phantom references, or finalizers (these are deprecated now). Even then, ZGC won't add more GC pauses for you (since it will clean or reclaim the memory concurrently).

As opposed to the store barriers that are used by another HotSpot GCs, ZGC uses load barriers. The load barriers are used to keep track of heap usage. One of the intriguing features of ZGC is the usage of load barriers with colored pointers. This is what enables ZGC to perform concurrent operations when Java threads are running, such as object relocation or relocation set selection.

ZGC is a region-based garbage collector. However, if you compare it to the G1 garbage collector, ZGC is more flexible in configuring its size and scheme. Compared to G1, ZGC has better ways to deal with very large object allocations.

ZGC is a single-generation GC. It also supports partial compaction. ZGC is also highly performant when it comes to reclaiming memory and reallocating it.

ZGC is NUMA-aware, which essentially means that it has a NUMA-aware memory allocator.

An experimental garbage collector, ZGC is only available on Linux/x64. More platform support will be added in the future if there is a considerable demand for it.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.187.233