JDK-8201492 : Properly implement non-contiguous generations for Reference discovery
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-04-12
  • Updated: 2022-04-18
  • Resolved: 2018-05-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b13Fixed
Related Reports
Duplicate :  
Relates :  
Description
Reference discovery does not properly support non-contiguous generations, resorting to an approximation of it.

This in turn causes G1 to require the "preserve cm referents" phase during GC during marking, which is very costly in some cases.

The current reason for the preserve cm referents phase is that References (j.l.ref.References instances) that are discovered by concurrent discovery, will currently prevent discovery and evacuation of referents by the STW ref processor, as it thinks that it already has discovered that Reference. Their referents can be in young gen, while the Reference is in old gen (young gc may iterate over it during card scanning), and this may cause crashes later.

The preserve cm referents phase brute-force evacuates any "leftover" referents and its followers.

This is because the STW ref discovery currently does not treat References in old gen as roots (i.e. to be scanned and referents evacuated always), as the STW reference processor thinks that the g1 heap is a single generation spanning the whole heap.

By giving the ref processor the correct idea of generations in G1, this automatically works, and obsoletes the "preserve cm referents".

To get an understanding how serious this issue may be, on the Kitchensink reference stress test program, the "Preserve CM referents" phase may take 105ms out of 115ms.
Comments
URL: http://hg.openjdk.java.net/jdk/jdk/rev/99e698e94cc7 User: tschatzl Date: 2018-05-03 12:10:50 +0000
03-05-2018