As the root node in java

GC Roots root object

Excerpt from "In-depth understanding of the Java virtual machine"

In the Java language, the objects that can be used as GC Root include the following:

  • Objects referenced in the virtual machine stack (local variable table in the stack frame)
  • Object referenced by class static property in method area
  • Objects referenced by constants in the method area
  • Objects referenced in JNI (the Navite method in general) in the local method stack

Guess you like

Origin blog.csdn.net/Longtermevolution/article/details/107850761