Skip to content
Sharp

Performance Tuning · interview question

How does the G1 Garbage Collector prioritize regions for collection?

Multiple choiceHardchapter-14-curatedpremiumperformance-tuningthread-dumps
Choose one answer
Answer and explanation

Correct answer

A. By the amount of garbage in each region

Why

The G1 Garbage Collector prioritizes regions that contain the most garbage, aiming to maximize the amount of space reclaimed with each collection cycle. This approach helps in managing large heaps efficiently.

Test yourself on Performance Tuning

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

Start free test
All Performance Tuning questions →