JDK-6712278 : Better fix for CMS+Compressed Oops
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs13
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2008-06-09
  • Updated: 2019-12-14
  • Resolved: 2019-12-14
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.
Related Reports
Relates :  
The fix for 6687581 (Make CMS work with compressed oops) is conditional on 64 bit and UseCompressedOops.  A more general solution has been suggested to make free chunks identifiable from oops in 32 bit as well, but shares bits with the CMS implementation of PromotedObject and ClaimedForwardPtr that would have to be resolved.

A partial fix/patch will be attached as the suggested fix (but it doesn't work).

From email:

>> You won't be just looking at that bit.   You look for 111 in the low 3 bits and that will be unique to CMS.
> But wont biased locking, is_marked and is_locked() be looking at those bits individually?  I don't know, sounds really confusing to share bits with other things even though different pattern.  I can't look at it now anyway because my vnc or system seems to have died.

The biased lock pattern is really 101.  That what made it clear to me.

         biased_lock_pattern      = 5

The biased bit isn't really separate from the other two bits.  The patterns we use are really:

101  biased
x00  stack locked
001  unlocked
x10  heavy weight locked
x11  marked

In the stack locked case the pointer isn't necessarily double word aligned but in the marked case it is which means that we could make that into 2 states, 011 for marked and 111 for free.  The heavy weight locked case is also probably double word aligned but I don't think we care.
It is unlikely we'll be able to fix this in 7, targeting to 8.

CMS has been removed - JDK-8229049

SUGGESTED FIX see patch attached.