Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8201492

Properly implement non-contiguous generations for Reference discovery


    • Subcomponent:
    • Resolved In Build:


      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.


          Issue Links



              • Assignee:
                tschatzl Thomas Schatzl
                tschatzl Thomas Schatzl
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: