java垃圾回收的可达性分析算法, 列举可以作为root的对象:
由于网上的博客回答都不全, 找了份来自help.eclipse.org的, 先上原文与连接供大佬参考, 后边挂上垃圾翻译, 不接受关于翻译的质疑! (认真脸)
Garbage Collection Roots
A garbage collection root is an object that is accessible from outside the heap. The following reasons make an object a GC root:
System Class
Class loaded by bootstrap/system class loader. For example, everything from the rt.jar like java.util.* .
JNI Local
Local variable in native code, such as user defined JNI code or JVM internal code.
J