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

G1: Investigate to avoid scanning an object in card table for multiple times

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 18
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Subcomponent:
      gc

      Description

      Remembered set scan might in some rare cases scan objects multiple times.

      Consider a regular object instance spanning multiple cards; it is marked (imprecisely) at the object header and e.g. in the tail card due to other objects needing scanning. The object spans multiple scan chunk (i.e. multiple threads process parts of it).

      Then it is possible that two threads scan that object at the same time: both thread A and B process it in full, pushing its oop* to the queues, allowing that oop* to be processed multiple times. Obviously once it will already have been forwarded, pointing to somewhere not in the cset.

      The card table scan code has been intentionally designed this way (and looking at it there is still no code preventing this situation) because guaranteeing the scanned exactly once property resulted in slower operation of the card table scan code when trying - but it would be an interesting task to see if that could be done better.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mli Hamlin Li
              Reporter:
              mli Hamlin Li
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: