Java VM: Trying a new Garbage Collector for JDK 7
Filed under: java javase vm on Wednesday Nov 12, 2008Like using the living room as the kids play area, tidying up, or garbage collection, is an integral part of life in the JVM. Except that the kids are applications and the toys on the floor the objects they create. But unlike in your living room, these kids don't sleep, are always playing with something, will scream if they have to wait while you tidy up, and will get seriously, seriously mad if they lose a toy. So how can you organize the mess they make without disrupting the game ?The HotSpot team has been quietly working on a new algorithm, called Garbage First, for tidying up the memory space in the JVM while the kids are playing, as a replacement for the existing parallel and concurrnet sweep collectors. By dividing the living rooms into equal squares, it turns out that for most games, many of the squares contain unused toys that can be safely put away. By picking the low hanging fruit in this way, the new collector can work more predictably, and be given directives to operate within given time slices, which it can follow most of the time. And of course, being fully concurrent, its ready made for multiple cores.
关注JDK1.7的GC新特性原文地址:
http://blogs.sun.com/theplanetarium/entry/java_vm_trying_a_new
Filed under: java javase vm on Wednesday Nov 12, 2008Like using the living room as the kids play area, tidying up, or garbage collection, is an integral part of life in the JVM. Except that the kids are applications and the toys on the floor the objects they create. But unlike in your living room, these kids don't sleep, are always playing with something, will scream if they have to wait while you tidy up, and will get seriously, seriously mad if they lose a toy. So how can you organize the mess they make without disrupting the game ?The HotSpot team has been quietly working on a new algorithm, called Garbage First, for tidying up the memory space in the JVM while the kids are playing, as a replacement for the existing parallel and concurrnet sweep collectors. By dividing the living rooms into equal squares, it turns out that for most games, many of the squares contain unused toys that can be safely put away. By picking the low hanging fruit in this way, the new collector can work more predictably, and be given directives to operate within given time slices, which it can follow most of the time. And of course, being fully concurrent, its ready made for multiple cores.
关注JDK1.7的GC新特性原文地址:
http://blogs.sun.com/theplanetarium/entry/java_vm_trying_a_new
HotSpot团队已经在新算法上研究了一番。新算法叫垃圾优先算法,是为了当有程序在运行的时候整理JVM里的内存空间。该算法将替换现有的平行并发锁的清除搜集器(这块我不太懂)。通过将起居室均分成一个个的区域,这样对于大部分的游戏,在许多区域里就会有一些没有用到的,可以被拿走的玩具。通过这种途径摘下位置低的水果(风险小的意思吧 呵呵),新式的收集器将会更有预见性的工作,能够在给定指令后指定的时间间隙里执行操作,而且在大部分的时候都能遵循这一方法。当然了,新式的垃圾回收机制已经支持了多核心了,从而实现真正的并发处理。
JDK1.7的GC新特性
关注,呵呵