Skip to content
Sharp

Performance Tuning · interview question

How does G1GC determine which regions of the heap to collect during a garbage collection cycle?

Multiple choiceHardchapter-14-curatedpremiumperformance-tuningstop-the-world-pauses
Choose one answer
Answer and explanation

Correct answer

A. By prioritizing regions with the most garbage

Why

G1GC prioritizes collecting regions that contain the most reclaimable memory (garbage). This approach helps in reducing overall heap usage more effectively by focusing on regions where space can be reclaimed most efficiently.

Test yourself on Performance Tuning

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

Start free test
All Performance Tuning questions →