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

Remove mark word from objects

    XMLWordPrintable

    Details

    • Type: JEP
    • Status: Draft
    • Priority: P4
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
      None
    • JEP Type:
      Feature
    • Exposure:
      Open
    • Subcomponent:
    • Scope:
      JDK

      Description

      Investigate downsizing average object size by removing (or downsizing) the mark word from the oopDesc layout.

      DRAFT DRAFT DRAFT

      The 64-bit mark word can be used for several purposes:

      • GC state during a GC, such as a forwarding pointer
      • lock state (not during a GC), including unlocked, thin-locked, biased, and inflated monitor
      • object annotations by GC (a few "age" bits)
      • storage for the System.identityHashCode
      • a tag to distinguish object instances from value instances

      There are well-known alternative representations for all of these mechanisms which do not use the 64-bit object header.

      For example:

      • GC state can be stored in a side array
      • lock state can be stored in a side array and/or in a word preceding the object
      • age annotations and "value tags" can be inserted into other "waste" space of the object, such as the high bits of the klass field (if it is present)
      • hash codes can be stored in a word before the object, and/or be derived from the object's address in new-space

      If we could remove mark words from all objects, the density of the heap would go up by a significant factor, basically (1+8/S), where S is the average object size; since S is typically something like 30-50 bytes (including arrays, which may be quite large), the overhead of mark words can often be a double-digit percentage.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jrose John Rose
              Owner:
              John Rose John Rose
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: