Could you please answer me a question about JVM Garbage Collection process?
Why is heap divided into Eden, Survivor spaces and Old Generation?
When a young evacuation is processed objects are visited through references starting from the roots to find out unreachable ones. Reachable objects are marked as ‘alive’ and unreachable are not marked and will be eliminated.
As a result, ALL objects are considered, including objects allocated in Old Generation are also visited and marked if they are reachable.
As I understand reclaiming Young Generation and Old Generation at once is demanding because these generations are located in different contiguous parts of memory.
But why do we need this division if even after the simplest marking on the Young evacuation level we have the entire bitmap with all alive and dead objects if all reachable and unreachable objects are known and can be deleted?
I also know weak generational hypothesis about but why do we need the division?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…