The GC scans the heap and detects cyclic references. If it finds cycles which are unreachable from anywhere else, it breaks the cycle so that the reference counting mechanism kicks in and those objects are destroyed. I've already covered how all of this happens in the earlier mentioned GC article.
Comments