Contents

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.