From IcedTea

Jump to: navigation, search


1 Shenandoah: An almost pauseless garbage collection algorithm.

1.1 Goals

Reduce GC pause times on extremely large heaps by doing evacuation work concurrently with Java threads and making pause times independent of heap size.

1.2 Brief description of the algorithm

Shenandoah is a region-based garbage collector with a heap structure similar to G1. Garbage collection in Shenandoah is performed in phases. The first phase is a marking phase, the second is an evacuation phase. Both activities are carried out concurrently with mutator threads, using several parallel GC threads. During the marking phase, all live objects in the heap are marked, starting from the GC roots (thread stacks, etc). A count of live data in each region is maintained. In the evacuation phase, the best regions to collect are identified and the live objects in those regions are copied to new regions. During the next concurrent marking phase all references are updated to point to the evacuated objects, and at the end of this phase the evacuated regions may be reclaimed. The key to performing concurrent evacuation is having the Java Threads and the GC threads agree on the location of objects. This is accomplished in Shenandoah by the use of a Brooks forwarding pointer. All reads by the Java Threads indirect through this forwarding pointer. All writes to objects in targeted regions must first copy the object and then write to the object in its new location. One advantage of this approach is that it is no longer necessary to maintain remembered sets. This collector will focus GC effort on the regions with the most garbage regardless of their age, as opposed to G1 which focuses on young generation collection to help limit remembered-set size.

1.3 Where can I download the sources?

Browse it all here: Fetch the JDK8 branch with:

hg clone
cd openjdk8

Or the JDK9 branch:

hg clone
cd jdk9-shenandoah

1.4 How do I build?

bash ./configure
make images

1.5 How do I run?

build/linux-amd64-debug/images/j2sdk-image/bin/java -XX:-UseCompressedOops -XX:+UseShenandoahGC

1.6 Get in touch

Shenandoah mailing list:

Personal tools