previous      content      next
 
GC roots

The so-called GC (Garbage Collector) roots are objects special for garbage
collector. Garbage collector collects those objects that are not GC roots and
are not accessible by references from GC roots.

There are several kinds of GC roots. One object can belong to more than one
kind of root. The root kinds are:

  • Class - class loaded by system class loader. Such classes can never
    be unloaded. They can hold objects via static fields. Please note that classes
    loaded by custom class loaders are not roots, unless corresponding instances of
    java.lang.Class happen to be roots of other kind(s).
  • Thread - live thread
  • Stack Local - local variable or parameter of Java method
  • JNI Local - local variable or parameter of JNI method
  • JNI Global - global JNI reference
  • Monitor Used - objects used as a monitor for synchronization
  • Held by JVM - objects held from garbage collection by JVM for its
    purposes. Actually the list of such objects depends on JVM implementation.
    Possible known cases are: the system class loader, a few important exception
    classes which the JVM knows about, a few pre-allocated objects for exception
    handling, and custom class loaders when they are in the process of loading
    classes. Unfortunately, JVM provides absolutely no additional detail for such
    objects. Thus it is up to the analyst to decide to which case a certain "Held by
    JVM" belongs.

If an object is a root, it is specially marked in all views showing
individual objects. For example, the following picture shows a fragment of paths view:

 
previous      content      next
 

GC roots 总结的更多相关文章

  1. gc roots 垃圾回收

    gc roots包括以下几个: 虚拟机栈(栈桢中的本地变量表)中的引用对象 方法区中的类静态属性引用的对象 方法区中的常量引用的对象 本地方法栈中JNI(即native方法)的引用的对象 java,c ...

  2. 枚举GC Roots的实现

    枚举根节点 从可达性分析中从GC Roots节点找引用链这个操作为例,可作为GC Roots的节点主要在全局性的引用(例如常量或类静态属性)与执行上下文(例如栈帧中的本地变量表)中,现在很多应用仅仅方 ...

  3. GC roots

    1.虚拟机栈(本地变量表)引用的对象 2.方法区静态属性引用的对象 3.方法区常量引用的对象 4.本地方法栈JNI(一般指naive方法)中引用的对象   常说的GC(Garbage Collecto ...

  4. JVM总括二-垃圾回收:GC Roots、回收算法、回收器

    JVM总括二-垃圾回收:GC Roots.回收算法.回收器 目录:JVM总括:目录 一.判断对象是否存活 为了判断对象是否存活引入GC Roots,如果一个对象与GC Roots没有直接或间接的引用关 ...

  5. 【JVM底层策略 一】GC roots如何判断对象不可达

    查找内存中不再使用的对象 引用计数法 引用计数法就是如果一个对象没有被任何引用指向,则可视之为垃圾.这种方法的缺点就是不能检测到环的存在. 2.根搜索算法 根搜索算法的基本思路就是通过一系列名为”GC ...

  6. JVM 垃圾回收GC Roots Tracing

    1.跟搜索算法: JVM中对内存进行回收时,需要判断对象是否仍在使用中,可以通过GC Roots Tracing辨别. 定义: 通过一系列名为”GCRoots”的对象作为起始点,从这个节点向下搜索,搜 ...

  7. 什么是GC Roots

    GC Root 2012年11月28日  ⁄ 综合 ⁄ 共 625字 ⁄ 字号  小 中 大  ⁄ 评论关闭   常说的GC(Garbage Collector) roots,特指的是垃圾收集器(Ga ...

  8. GC Roots的理解以及如何判断一个对象为“垃圾”

    http://blog.csdn.net/Great_Smile/article/details/49935307 这篇博客中讲解了哪些可以作为GC Roots以及如何判断一个对象为垃圾

  9. Java 虚拟机枚举 GC Roots 解析

    JVM 堆内存模型镇楼. 读<深入理解 Java 虚拟机>第三章GC算法,关于 GC Roots 枚举的段落没说透彻,理解上遇到困惑.因此对这点进行扩展并记录,发现国内各种博客写来写去都是 ...

随机推荐

  1. http://blog.csdn.net/itplus/article/details/10088625

    http://blog.csdn.net/itplus/article/details/10088625 DBSCAN

  2. [转载]mvc使用JsonResult返回Json数据

    controller 中定义以下方法: public JsonResult UpdateSingle(int id, string actionName, string actionValue) { ...

  3. 下一代Jquery模板-----JsRender

    在ASP.NET MVC利用PagedList分页(二)PagedList+Ajax+JsRender中提到了JsRender.JsRedner和JsViews(JsViews是再JsRender基础 ...

  4. 如何在WINDOWS下编译BOOST C++库 .

    如何在WINDOWS下编译BOOST C++库 cheungmine 2008-6-25   写出来,怕自己以后忘记了,也为初学者参考.使用VC8.0和boost1.35.0.   1)下载boost ...

  5. POJ 3191 The Moronic Cowmpouter(进制转换)

    题目链接 题意 : 将一个10进制整数转化为-2进制的数. 思路 :如果你将-2进制下的123转化为十进制是1*(-2)^2+2*(-2)^1+3*(-2)^0.所以十进制转化为-2进制就是一个逆过程 ...

  6. POJ3034+DP

    题意:给定一个N*N的矩阵, 然后在这个矩阵的每个格子在任意时间会出现一个鼹鼠,这个出现     出现鼹鼠的时间是输出信息所确定的. 现在你手里有一把锤子能够去锤这些鼹鼠. 你能     够移动锤子, ...

  7. FZU-1924+判断环/DFS/BFS

    dfs: /* dfs */ #include<stdio.h> #include<string.h> #include<stdlib.h> #include< ...

  8. uploadify 下载组件使用技巧和在线预览 word,excel,ppt,pdf的方案

    http://www.cnblogs.com/wolf-sun/p/3565184.html uploadify 上传工具的使用技巧 http://www.cnblogs.com/wolf-sun/p ...

  9. SRM 586 DIV1 L1

    可以化简为求n条线段的最大覆盖问题,需要注意的是对于实数而言. #include <iostream> #include <vector> #include <strin ...

  10. *gravity的取值详表

    android有 android:layout_gravity 和 android:gravity,前者设置相对父控件布局,后者是设置自己内部的控件的布局. Value Description top ...