Skip to content
Sharp

Engineering Interviews · interview question

In the context of Java memory management, what is the primary role of the Survivor spaces?

Multiple choiceMediumchapter-20-curatedpremiumengineering-interviewsjvm-trivia
Choose one answer
Answer and explanation

Correct answer

D. To hold short-lived objects that survive initial garbage collection.

Why

Survivor spaces in Java's Young Generation hold objects that have survived one or more garbage collection cycles in the Eden space. This helps in efficiently managing the lifecycle of objects, allowing them to be promoted to the Old Generation if deemed long-lived.

Test yourself on Engineering Interviews

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

Start free test
All Engineering Interviews questions →