JEP 307: Parallel Full GC for G1

OwnerStefan Johansson
TypeFeature
ScopeImplementation
StatusClosed / Delivered
Release10
Componenthotspot / gc
Discussion hotspot dash gc dash dev at openjdk dot java dot net
EffortM
DurationM
Reviewed byMikael Vidstedt
Endorsed byMikael Vidstedt
Created2017/01/17 11:40
Updated2018/03/29 07:39
Issue8172890

Summary

Improve G1 worst-case latencies by making the full GC parallel.

Non-Goals

Match the performance of the parallel collector's full GC for all use cases.

Motivation

The G1 garbage collector was made the default in JDK 9. The previous default, the parallel collector, has a parallel full GC. To minimize the impact for users experiencing full GCs, the G1 full GC should be made parallel as well.

Description

The G1 garbage collector is designed to avoid full collections, but when the concurrent collections can't reclaim memory fast enough a fall back full GC will occur. The current implementation of the full GC for G1 uses a single threaded mark-sweep-compact algorithm. We intend to parallelize the mark-sweep-compact algorithm and use the same number of threads as the Young and Mixed collections do. The number of threads can be controlled by the -XX:ParallelGCThreads option, but this will also affect the number of threads used for Young and Mixed collections.

Testing

Risks and Assumptions