- 浏览: 352196 次
- 性别:
- 来自: 南京
博客专栏
-
设计模式那些事儿
浏览量:5761
文章分类
- 全部博客 (85)
- news (3)
- java面试题 (3)
- java基础 (2)
- 英语短文 (2)
- 英语演讲 (2)
- Weekly Address (5)
- 英语写作 (2)
- 转载 (1)
- 2010 FIFA World Cup (5)
- Scrum (1)
- 计算机基础 (2)
- java引用对象 (1)
- 英语阅读 (1)
- Ext (6)
- Javascript (3)
- Web编程 (4)
- 战国策 (7)
- html (1)
- java (33)
- concurrency (1)
- jvm (31)
- 方法区 (9)
- 栈 (5)
- 堆 (1)
- 程序计数器 (1)
- 本地方法栈 (1)
- class file (5)
- 常量池 (2)
- attributes (1)
- 连接模型 (1)
- applet (1)
- gc (5)
- 垃圾收集 (5)
- 方法调用 (2)
- IBM (0)
- 门户(Portal) (0)
- Solr (1)
- Lucene (1)
- 全文检索 (1)
- 设计模式 (4)
- 责任链模式 (1)
- 责任链 (1)
- COR (1)
- Pattern (1)
最新评论
-
Nabulio:
是不错的
Java的Integer与int互转 -
shihengli2010:
学习了 !Integer i = 100; Integer ...
Java的Integer与int互转 -
flex涵:
还可以,差不多就是这个意思.
Java的Integer与int互转 -
lijingshou:
相当好用。。。
输入年月日格式yyyyMMdd,判断是否是周末 -
denverj:
你好,是这本书的英文版,名字叫<Inside the J ...
JVM学习笔记-帧数据区(Frame Data)
Reference Counting Collectors
Reference counting was an early garbage collection strategy. In this approach, a reference count is maintained for each object on the heap. When an object is first created and a reference to it is assigned to a variable, the objectís reference count is set to one. When any other variable is assigned a reference to that object, the object's count is incremented. When a reference to an object goes out of scope or is assigned a new value, the object's count is decremented. Any object with a reference count of zero can be garbage collected. When an object is garbage collected, any objects that it refers to have their reference counts decremented. In this way the garbage collection of one object may lead to the subsequent garbage collection of other objects.
引用计数是垃圾收集的早期策略。在这种方法中,堆中每一个对象都有一个引用计数。一个对象被创建了,并且指向该对象的引用被分配给一个变量,这个对象的引用计数被置为1。当任何其他变量被赋值为对这个对象的引用时,计数加1。当一个对象的引用超过了生存期或者被设置一个新的值时,对象的引用计数减1。任何引用计数为0的对象可以被当作垃圾收集。当一个对象被垃圾收集的时候,它引用的任何对象计数值减1。在这种方法中,一个对象被垃圾收集后可能导致后续其他对象的垃圾收集行动。
An advantage of this approach is that a reference counting collector can run in small chunks of time closely interwoven with the execution of the program. This characteristic makes it particularly suitable for real-time environments where the program can't be interrupted for very long. A disadvantage is that reference counting does not detect cycles: two or more objects that refer to one another. An example of a cycle is a parent object that has a reference to a child object that has a reference back to the parent. These objects will never have a reference count of zero even though they may be unreachable by the roots of the executing program. Another disadvantage of reference counting is the overhead of incrementing and decrementing the reference count each time.
这种方法的好处是,引用计数收集器可以很快地执行,交织在程序的运行之中。这个特性对于程序不能被长时间打断的实时环境很有利。坏处就是,引用计数无法检测出循环(即两个或者更多的对象互相引用)。循环的例子如,父对象有一个对子对象的引用,子对象又反过来引用父对象。这些对象永远都不可能计数为0,就算它们已经无法被执行程序的根对象可触及。还有一个坏处就是,每次引用计数的增加或者减少都带来额外开销。
Because of the disadvantages inherent in the reference counting approach, this technique is currently out of favor. It is more likely that the Java Virtual Machines you encounter in the real world will use a tracing algorithm in their garbage-collected heaps.
因为引用计数方法固有的缺陷,这种技术现在已经不为人所接受。现实生活中所遇到的Java虚拟机更有可能在垃圾收集堆中使用追踪算法。
发表评论
-
java书籍
2011-12-15 15:31 0线程 Java Concurrency in Pra ... -
JVM学习笔记-本地方法调用(Invoking a Native Method)
2011-11-25 11:56 1155Invoking a Native Method ... -
JVM学习笔记-调用Java方法(Invoking a Java Method)
2011-11-25 11:35 1512Invoking a Java Method As m ... -
JVM学习笔记-分代收集器(Generational Collectors)
2011-11-23 14:41 1922Generational Collectors ... -
JVM学习笔记-拷贝收集器(Copying Collectors)
2011-11-22 16:34 1601Copying Collectors Copy ... -
JVM学习笔记-压缩收集器(Compacting Collectors)
2011-11-22 16:17 1320Compacting Collectors G ... -
JVM学习笔记-跟踪收集器(Tracing Collectors)
2011-11-22 16:04 1907Tracing Collectors Trac ... -
applet notinited的解决方案
2011-11-13 14:45 4517最近项目当中正好使用到了applet,这个很少接触过的东东。 ... -
JVM学习笔记-动态连接和解析(Dynamic Linking and Resolution)
2011-11-08 11:09 3432When you compile a Java pro ... -
JVM学习笔记-属性格式(Attributes Types)
2011-11-07 12:15 1483Attributes The Java Vir ... -
JVM学习笔记-属性(Attributes)
2011-11-07 12:03 1509Attributes As mentioned ... -
JVM学习笔记-方法(Methods)
2011-11-07 11:25 2220Methods Each method dec ... -
JVM学习笔记-字段(Fields)
2011-11-07 11:17 1908Each field (class variable a ... -
JVM学习笔记-特殊字符串(Special Strings)
2011-11-05 14:33 1666Special Strings 特殊字符串 T ... -
JVM学习笔记-Class文件(Class File)
2011-11-05 14:39 1590What is a Java Class Fi ... -
JVM学习笔记-本地方法栈(Native Method Stacks)
2011-11-02 10:16 19180本地方法栈(Native Me ... -
JVM学习笔记-帧数据区(Frame Data)
2011-10-28 09:16 1718In addition to the local var ... -
JVM学习笔记-操作数栈(Operand Stack)
2011-10-27 11:12 14083Like the local variables, th ... -
JVM学习笔记-局部变量区(Local Variables)
2011-10-27 10:42 2991The local variables secti ... -
JVM学习笔记-栈帧(The Stack Frame)
2011-10-27 10:35 2514The stack frame has three pa ...
相关推荐
jvm 调优笔记-jvm
Moonbox(月光宝盒)是JVM-Sandbox生态下的,基于jvm-sandbox-repeater重新开发的一款流量回放平台产品。在jvm-sandbox-repeater基础上提供了更加丰富功能,同时便于线上部署和使用,更多对比参考。 使用场景 你...
3.2.1 Reference Counting(引用计数) 22 3.2.2 跟踪收集器 22 3.3 JVM的垃圾收集策略 27 3.3.1 Serial Collector 28 3.3.2 Parallel Collector 29 3.3.3 Concurrent Collector 30 Java虚拟机(JVM)参数配置说明 30
nginx-upstream-jvm-route 支持nginx版本1.15 解决nginx: [emerg] invalid parameter "srun_id=tomcat1" 问题
JVM调优总结 -Xms -Xmx -Xmn -Xss
赠送jar包:metrics-jvm-3.1.5.jar; 赠送原API文档:metrics-jvm-3.1.5-javadoc.jar; 赠送源代码:metrics-jvm-3.1.5-sources.jar; 赠送Maven依赖信息文件:metrics-jvm-3.1.5.pom; 包含翻译后的API文档:...
JVM性学习笔记-基本原理,内存模型,JVM参数设置,类加载器原理,JDK自带工具
jvm-full-gc调优-jvm-full-gc
java之jvm学习笔记十一(访问控制器)-源码
nginx-upstream-jvm-route-0.1.tar.gz 用来实现Nginx Tomcat 集群session复制的问题!
代码如下:failed to create jvm error code -4 这一般应是内存不够用所致,解决方法参考如下。 打开 Android Studio 安装目录下的bin目录,查找并打开文件 studio.exe.vmoptions,修改代码: 代码如下:-Xmx512m 为...
jvm性能调优-垃圾收集器parnew&CMS底层三色标记算-performance-gc-parnew-cms
mini-jvm in rust实现jvm,jvm-rs-main.zip
赠送jar包:metrics-jvm-3.1.5.jar; 赠送原API文档:metrics-jvm-3.1.5-javadoc.jar; 赠送源代码:metrics-jvm-3.1.5-sources.jar; 赠送Maven依赖信息文件:metrics-jvm-3.1.5.pom; 包含翻译后的API文档:...
JVM调优总结 -Xms -Xmx -Xmn -Xss JVM调优总结 -Xms -Xmx -Xmn -Xss
nginx_upstream_jvm_route 是一个 Nginx 的扩展模块,用来实现基于 Cookie 的 Session Sticky 的功能。 安装方法(进入Nginx源码目录): #patch -p0 < /path/to/this/directory/jvm_route.patch # ./configure -...
一份JVM学习的笔记,含查看JVM运行时信息\JVM垃圾收集信息\JVM锁信息等
JVM,MIB,可通过SNMP协议监控JVM运行情况
jvm性能调优-jvm内存模型和优化-performance-jvm-memorymodel-optimize
Java分布式应用学习笔记-谈JVM