This document introduces the types of GC root objects, a key concept in Java memory management. A garbage collector identifies all live objects by starting from these roots and traversing their object references.
GC root objects
GC Roots are objects in specific regions from which the garbage collector starts scanning for live objects. For example, in the graph below, the garbage collector starts from the thread stack area, finds objects A and B, and then uses these two objects as starting points to scan for other objects.

Different areas hold different types of GC root objects, such as JNI Global, System Class, Thread, and Busy Monitor. In the GC root object list of a heap dump, you can view the object count, shallow size, and retained size for each root type.
GC root object types
|
Type |
Description |
|
Unknown |
An unknown root type. |
|
System Class |
A |
|
JNI Local |
A JNI local reference. |
|
JNI Global |
A JNI global reference. |
|
Thread Block |
An object referenced from an active thread block. |
|
Busy Monitor |
An object used for thread synchronization, such as an object in a |
|
Java Local |
A local variable on a thread's stack frame. |
|
Native Stack |
An object passed as an argument to a native method. |
|
Thread |
A running |
|
Finalizable |
An object in the finalization queue, waiting for its |
|
Unfinalized |
An object with a |
|
Unreachable |
An object unreachable from any GC root and therefore eligible for garbage collection. |
|
stack frame |
A frame on a thread's call stack that holds local variables. |
|
nmethod |
A method compiled to native code by the Just-In-Time (JIT) compiler. |