I am trying to understand the mechanisms of garbage collection, and I'm on generator algorithms, and I have a question about the differences between the young / old generations. I read that to start collecting objects in the young generation, the GC marks them, starting with the roots of the GC, to find the living, and usually he copies them into the space for salvation, cleans the area of the young generation and voila.
I don’t understand if we start with the roots of the GC and we begin to go through living objects, will we not find the object in the old generation? Does this mean that when we hit an object in the old space, we stop tracking links at that point or what?
source
share