GcRoot可以有哪些?

GC会收集那些不是GCRoots且没有被GCRoots引用的对象。

  1. 虚拟机栈:栈帧中的本地变量表引用的对象

  2. native方法引用的对象

  3. 方法区中的静态变量和常量引用的对象

results matching ""

    No results matching ""