- 漏洞監測報告:自動檢測 dump 文件 的漏洞。報告哪些對象還存活,並且爲什麼沒有被垃圾回收。
- 組件報告:分析可能引用內存問題的對象:比如 空字符串,空集合等。
- 重新打開之前的運行報告。
public class Student {
public static void main(String[] args) {
Stu1 stu1 = new Stu1();
Stu2 stu2 = new Stu2();
stu1.setStu2(stu2);
try {
Thread.sleep(60 * 60 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
class Stu1{
private String name;
private Stu2 stu2;
public void setStu2(Stu2 stu2){this.stu2 = stu2;}
}
class Stu2{
private String name;
}
那麼,就可以如下圖找到誰引用誰(by outgoing reference 就是該對象引用誰, by incoming references 就是 誰引用它):
例如:點擊 Stu1 的 by outgoing references,如下圖:
可以看到,Stu1 引用了 1個 Stu2 對象,這也是符合上述的main函數的。