Java development for a few years, today just know the Java Memory Recovery algorithm, is ashamed of ashamed
The Java Virtual machine determines whether an object instance can be recycled, not a reference counting algorithm.
Because the reference counting algorithm is difficult to solve the problem that objects refer directly to each other.
So Java C # uses accessibility analysis to determine whether an object can be recycled.
The basic idea of this algorithm is to use a series of objects called "GC Root" as the starting point, starting from these nodes to search for the elements, the path is called the application chain, when an object to the GC roots no reference chain connected. When this object is proved to be unavailable, it can be recycled. such as Object OBJECT5,OBJECT6,OBJECT7 although related to each other, but no GC roots can reach them. So they can be recycled when the object.
JAVAVM an accessibility analysis algorithm that determines when an object instance is recycled, rather than a reference counting algorithm