My understanding is that during garbage collection the hotspot JVM will:
- Walk through GC root, and mark all objects on the PATH as reachable. Not consider static object, JVM will find GC root on statck by OopMap.
- JVM will "sweep" the unreachable object. So the JVM must also find out the unreachable object reference. I guesss it can also leverage OopMap. I think the OopMap is on the stack, so if the stack frame is popped, JVM lost references...
My questions are:
- How does the JVM find an unreachable object if the stack frame is not popped?
- How does the JVM find an unreachable object if the stack frame is popped?