JDK-7132678 : G1: verify that the marking bitmaps have no marks for objects over TAMS
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-01-24
  • Updated: 2015-01-21
  • Resolved: 2014-04-29
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 8 JDK 9
8u40Fixed 9 b13Fixed
Description
In G1, we have two copies of the marking information: prev (the last marking information we obtained which is consistent) and next (the marking information we are obtaining / will obtain and it might be incomplete / inconsistent).

Each marking information consists of the TAMS (top-at-mark-start) field per heap region + a marking bitmap that spans the heap. An object is considered live if it's either in the range [bottom,tams) and is marked on the bitmap (such objects are considered "explicitly live") or if it's in the range [tams,end) (such objects are considered "implicitly live").

We assume that the bitmap range that corresponds to [tams,end) has no marks. It doesn't hurt to have them, but it'd be much simpler if there were no marks there to avoid spurious marks accidentally appearing on the bitmap in the future, which might cause crashes (e.g., during marking, we iterate over the bitmap to find live objects; a spurious mark might cause a marking thread to think that an address in the middle of an object contains an object header).

To ensure that the above assumption holds, we should add code enabled by a develop flag (say: G1VerifyBitmaps) that verifies the above assumption.