JDK-8270924 : G1: Investigate to avoid scanning an object in card table for multiple times
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 18
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-07-20
  • Updated: 2024-02-23
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.
Other
tbdUnresolved
Related Reports
Duplicate :  
Relates :  
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.