Skip to content

Commit fe0d484

Browse files
java虚拟机开始学习
1 parent c0823a1 commit fe0d484

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/com/sun/jvm/Jvm/finalize/FinalizeEscapeGC.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* @Despacito TODO
66
* @Author chenzhuo
77
* @Version 1.0
8+
*
9+
*
810
* Finalize导致gc失效
911
* finalize 放在 finalize-Queue中 在一个低级的线程中执行
1012
* finalize() 只能被执行一次

src/main/java/com/sun/jvm/Jvm/gcRoots/GCRootTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public static void main(String[] args) {
8080
* Metaspace used 3223K, capacity 4500K, committed 4864K, reserved 1056768K
8181
* class space used 349K, capacity 388K, committed 512K, reserved 1048576K
8282
*/
83+
//没有设置为null的时候,回收的时候会遍历next的所以节点,所以会很耗时间
84+
//但是把next的set为null的时候 就变为不可达状态
8385
// next = null; help gc
8486
triggerGC();
8587
}

0 commit comments

Comments
 (0)