Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is ZGC: A Scalable Low-Latency Garbage Collector in Java 15?
Answer:

The Z Garbage Collector, or ZGC, promises not to exceed pause times of 10 ms while reducing overall application throughput by no more than 15% compared to the G1GC (the reduction in throughput is the cost of low latency).

ZGC supports heap sizes from 8 MB up to 16 TB.

The pause times are independent of both the heap size and the number of surviving objects.

Like G1, ZGC is based on regions, is NUMA compatible and can return unused memory to the operating system.

You can configure ZGC with a "soft" heap upper limit (VM option -XX:SoftMaxHeapSize): ZGC will only exceed this limit if necessary to avoid an OutOfMemoryError.

To activate ZGC, use the following VM option:

-XX:+UseZGC

Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook