Skip to content
Discussion options

You must be logged in to vote

G1 Garbage Collector

Uses STW + concurrent phases
Heavy write barriers (card marking)
Relies on memory fences for region tracking
Moderate CPU overhead, predictable pauses

Z Garbage Collector

Fully concurrent, pause ≈ minimal
Uses colored pointers + load barriers
Fewer global fences, more per-access checks
Higher CPU cost, super low latency

Shenandoah GC

Concurrent evacuation
Read + write barriers (brooks pointer)
More barrier hits → higher CPU overhead
Low pauses, slightly heavier than ZGC

Parallel GC

Mostly stop-the-world
Minimal barriers (simple write barrier)
Less fence complexity
Best CPU efficiency, worst latency

TL;DR:

More concurrency → more barriers & CPU cost
Less latency → more…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant