Tuesday, November 11, 2008

New garbage collector G1 available in JDK7 / OpenJDK

Ø Snip from http://jeremymanson.blogspot.com/2008/11/g1-garbage-collector-in-latest-openjdk.html

G1 is supposed to provide a dramatic improvement on existing GCs. There was a rather good talk about it at this year's JavaOne. It allows the user to provide pause time goals, both in terms of actual seconds and in terms of percentage of runtime.

The principle is simple: the collector splits the heap up into fixed-size regions and tracks the live data in those regions. It keeps a set of pointers — the "remembered set" — into and out of the region. When a GC is deemed necessary, it collects the regions with less live data first (hence, "garbage first"). Often, this can mean collecting an entire region in one step: if the number of pointers into a region is zero, then it doesn't need to do a mark or sweep of that region.

Ø White paper describing the “Garbage-First Garbage Collection” algorithm: http://research.sun.com/jtech/pubs/04-g1-paper-ismm.pdf

No comments: