Java’s G1 garbage collector would gain from higher throughput and decreased CPU use by means of a program remaining floated in the OpenJDK local community.
A draft JDK Improvement Proposal (JEP) titled, “Throughput article-write barrier for G1,” would have the collector use a throughput-optimized barrier when concurrent refinement has been disabled to obtain greater throughput at the price of latency on particular workloads that are not latency-delicate.
The approach would be carried out by a new JVM flag,
-XX:-G1UseConcRefinement, which would switch off concurrent refinement and let G1 to use a “throughput submit-compose barrier.”
G1UseConcRefinement would be enabled by default, while the use of
-XX:-G1UseConcRefinement would raise G1’s throughput and cut CPU usage, in accordance to the proposal. The simplified create barrier would be significantly shorter in size, improving upon the cache strike level. This manner would reduce the workload for dealing with a filthy card and compilation do the job for JIT compilers. Additional, the method would reduce memory footprint by shrinking remembered sets and not working with per-thread dirty card queues.
G1 currently has a additional complex put up-reference compose barrier than produce barriers for extra traditional collectors this kind of as the Concurrent Mark Sweep collector. This complexity is mainly due to help for concurrent refinement, which moves some scanning perform in the collection pause to do the job remaining done concurrently to the software. The refinement system incurs noticeable overhead all through execution.
The proposal would not allow the JVM identify when to disable concurrent refinement and improve limitations. Nor would the proposal limit the availability of other G1 capabilities this sort of as string deduplication when concurrent refinement is disabled.