Skip to content
Sharp

Garbage Collection · interview question

How does the G1 Garbage Collector differ from traditional Generational Garbage Collection?

Multiple choiceHardchapter-14-curatedpremiumgarbage-collectiongenerational-gc
Choose one answer
Answer and explanation

Correct answer

A. G1 uses regions instead of fixed generations.

Why

The G1 Garbage Collector divides the heap into regions and can perform garbage collection on these regions independently, rather than being limited to fixed Young and Old Generations.

Test yourself on Garbage Collection

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

Start free test
All Garbage Collection questions →