Skip to content
Sharp

Performance Tuning · interview question

How does the G1 Garbage Collector achieve its goal of predictable pause times?

Multiple choiceMediumchapter-14-curatedpremiumperformance-tuningoutofmemoryerrors
Choose one answer
Answer and explanation

Correct answer

D. By collecting garbage from regions with the most garbage first.

Why

G1 GC divides the heap into many regions and prioritizes the collection of regions with the most reclaimable garbage. This approach helps it achieve more predictable pause times by spreading the workload across smaller, more manageable units.

Test yourself on Performance Tuning

A free test with instant, explained results. No account needed.

Start free test
All Performance Tuning questions →