Can someone please explain to me how does Java garbage collector realize those memory blocks (pictured in red area) are garbage when their reference count is more that 0 when they are practically inaccessible?

Can someone please explain to me how does Java garbage collector realize those memory
Share
There’s set of “root objects” which are considered always accessible: e.g., Thread references, static variables, class references. If some object can not be reached via link of references from these root objects, it considered to be available for GC, even if there are some references to that object.