Comparison of throughput and pause time between ZGC, G1 and Parallel Scavenge

Preface

Official website description about comparison between various GCs

image-1669389799242
translate:

  • Parallel GC can only compress and reclaim space in the old generation as a whole. G1 gradually distributes this work across multiple shorter sets. This results in significantly shorter pause times at the expense of potential throughput.
  • G1 concurrently performs partial old generation space reclamation.
  • G1 may exhibit higher overhead than the above collectors, affecting throughput due to its concurrent nature.
  • ZGC targets very large heaps and aims to provide shorter pause times at the expense of higher throughput.

Throughput

Currently, Parallel Scavenge has the highest throughput when the expected pause time (Critical Throughput) is not set , because Parallel Scavenge is based on the mark-copy algorithm and focuses on throughput. But even in this case, ZGC still reached 99% of Parallel Scavenge, which aims at high throughput, directly surpassing G1.
When the expected pause time is set (such as 10 milliseconds to 100 milliseconds), the performance of ZGC exceeds that of the Parallel Scavenge collector.

Data shown in figure

image-1669389701133

pause time

In the pause time test, which is ZGC's strength, it mercilessly opened a gap of two orders of magnitude with Parallel Scavenge and Gl. Whether it is the average pause, 95% pause, 99% pause, 99.9% pause, or the maximum pause time, ZGC can effortlessly control it within ten milliseconds, so that it is close to the other two pauses of hundreds of milliseconds. Thousand millisecond collectors are put together for comparison.

Data shown in figure

image-1669389722850

Test Data

Illustration from http://spec.org/jbb2015

Guess you like

Origin blog.csdn.net/qq_49619863/article/details/128046259
ZGC