Bober02
Bober02

Reputation: 15351

Java garbage collection - finding set of root nodes

At the beginning of every garbage collection, GC thread needs to figure out what the set of root nodes i.e. those objects that are at the top of reachability hierarchy. Does anyone know how this process is achieved? Is a list maintained and new objects are added/removed on stack frame push/pop? Does JVM scan the stack and figures out what is an object and what isn't (if so - how?)? Also, what about static members, that are available for the duration of the process, do they somehow get added to the list?

Thanks a lot for any info.

Upvotes: 0

Views: 60

Answers (0)

Related Questions