Given a memory state like this:
(1) GC root -> A
(2) GC root -> B
(3) B -> GC root
where "->" means "has a reference to".
Now imagine one removes the references from GC root to A and B. I know that A will be garbaged collected, as it's not reachable anymore.
But what about B? It's not reachable from the GC root, but it has a reference to the GC root, which is still alive. Is B now garbage collected or not? Or in other words: for finding orphaned objects, is the analysis only done in one direction, from GC root to other objects?