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:

GC roots 总结的更多相关文章
- gc roots 垃圾回收
gc roots包括以下几个: 虚拟机栈(栈桢中的本地变量表)中的引用对象 方法区中的类静态属性引用的对象 方法区中的常量引用的对象 本地方法栈中JNI(即native方法)的引用的对象 java,c ...
- 枚举GC Roots的实现
枚举根节点 从可达性分析中从GC Roots节点找引用链这个操作为例,可作为GC Roots的节点主要在全局性的引用(例如常量或类静态属性)与执行上下文(例如栈帧中的本地变量表)中,现在很多应用仅仅方 ...
- GC roots
1.虚拟机栈(本地变量表)引用的对象 2.方法区静态属性引用的对象 3.方法区常量引用的对象 4.本地方法栈JNI(一般指naive方法)中引用的对象 常说的GC(Garbage Collecto ...
- JVM总括二-垃圾回收:GC Roots、回收算法、回收器
JVM总括二-垃圾回收:GC Roots.回收算法.回收器 目录:JVM总括:目录 一.判断对象是否存活 为了判断对象是否存活引入GC Roots,如果一个对象与GC Roots没有直接或间接的引用关 ...
- 【JVM底层策略 一】GC roots如何判断对象不可达
查找内存中不再使用的对象 引用计数法 引用计数法就是如果一个对象没有被任何引用指向,则可视之为垃圾.这种方法的缺点就是不能检测到环的存在. 2.根搜索算法 根搜索算法的基本思路就是通过一系列名为”GC ...
- JVM 垃圾回收GC Roots Tracing
1.跟搜索算法: JVM中对内存进行回收时,需要判断对象是否仍在使用中,可以通过GC Roots Tracing辨别. 定义: 通过一系列名为”GCRoots”的对象作为起始点,从这个节点向下搜索,搜 ...
- 什么是GC Roots
GC Root 2012年11月28日 ⁄ 综合 ⁄ 共 625字 ⁄ 字号 小 中 大 ⁄ 评论关闭 常说的GC(Garbage Collector) roots,特指的是垃圾收集器(Ga ...
- GC Roots的理解以及如何判断一个对象为“垃圾”
http://blog.csdn.net/Great_Smile/article/details/49935307 这篇博客中讲解了哪些可以作为GC Roots以及如何判断一个对象为垃圾
- Java 虚拟机枚举 GC Roots 解析
JVM 堆内存模型镇楼. 读<深入理解 Java 虚拟机>第三章GC算法,关于 GC Roots 枚举的段落没说透彻,理解上遇到困惑.因此对这点进行扩展并记录,发现国内各种博客写来写去都是 ...
随机推荐
- 小小地预览HTML5
程序示例 <!doctype html> <html> <head> <title>First </title> <meta char ...
- vs2010 使用SignalR 提高B2C商城用户体验(二)
vs2010 使用SignalR 提高B2C商城用户体验(二) 上一节,已经实现了,当前域内的通信,这一节中,介绍一下跨域的即时通信,既然要做,我们肯定要把这个推送及聊天服务器做为一个单独的服务器,以 ...
- query specified join fetching, but the owner of the fetched association was not present in the select list
报标题的错误,是因为在 select count的时候,不需要fetch 所以在取完count以后,再把fetch加进去,变成left join fetch /** * 请把jhql以o为返回对象, ...
- [转载]MVC3缓存:使用页面缓存
在以前的WebForm的开发中,在页面的头部加上OutputCache即可启用页面缓存,而在MVC3中,使用了Razor模板引擎的话,该如何使用页面缓存呢?如何启用 在MVC3中要如果要启用页面缓存, ...
- VS2005(vs2008,vs2010)使用map文件查找程序崩溃原因
VS 2005使用map文件查找程序崩溃原因 一般程序崩溃可以通过debug,找到程序在那一行代码崩溃了,最近编一个多线程的程序,都不知道在那发生错误,多线程并发,又不好单行调试,终于找到一个比较好的 ...
- hdu 4291 A Short problem
数学题,找循环节!! 首先g(g(g(n)))=g(x) mod 1e9+7 则可知x有循环节1e9+7; 之后x=g(g(n)),则可算出g(n)的循环节,在算出n的循环节就可以了!! 代码如下: ...
- http://nxlhero.blog.51cto.com/962631/1666250?plg_nld=1&plg_uin=1&plg_auth=1&plg_nld=1&plg_usr=1&plg_vkey=1&plg_dev=1
http://nxlhero.blog.51cto.com/962631/1666250?plg_nld=1&plg_uin=1&plg_auth=1&plg_nld=1&am ...
- [itint5]树中最大路径和
http://www.itint5.com/oj/#13 要注意,一是空路径也可以,所以最小是0.然后要时刻注意路径顶多有两条子路径+根节点组成,所以更新全局最值时和返回上一级的值要注意分清. #in ...
- [Unity菜鸟] Unity Web Player 相关问题 (待完善)
1. 发布网页版Unity自适应网页大小 发布网页版,Unity3D自适应网页大小.这个问题困扰了我很长时间,今天终于把他解决了,给大家分享一下. 这里用Uinty4.0发布网页版,我去掉了里面的标题 ...
- AC题目简解-dp
dp类:A - Bridging signals ZOJ 3627 POJ1631 HDU1950给出一个从1-n的数字排列,求最长上升子序列长度.直接说解法吧.新开一个数组d,d[i]表示的是能构成 ...