Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In Oracle's Java Virtual Machine's Garbage Collector, what are the respective roles of "survivor 1" and "survivor 2" ?

Are the objects always moving like: Eden → Survivor 1 → Survivor 2

Or can an object jump directly from Eden to Survivor 2?

Would a "Survivor 3" make no sense, or it could be OK but it was deemed that two are enough?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Survivor1 and Survivor2 are used alternately. Minor GCs scan everything in one survivor space, and move anything that's still needed into the other one, so exactly two are needed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.