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

Add experimental -XX:+UseCompactObjectHeaders flag

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P4 P4
    • tbd
    • hotspot
    • None
    • behavioral
    • minimal
    • Hide
      Assuming no implementation errors, there should only be no user-observable differences, besides performance changes. Initially, the identity-hashcode will have a reduced width (26 vs. 31 bits). There are plans for future iterations of compact object headers to resolve this limitation. Also, using serviceability tools (e.g. heap-dumps, JFR, JMX, GC log files), a user will observe smaller object sizes, but this is intentional.
      Show
      Assuming no implementation errors, there should only be no user-observable differences, besides performance changes. Initially, the identity-hashcode will have a reduced width (26 vs. 31 bits). There are plans for future iterations of compact object headers to resolve this limitation. Also, using serviceability tools (e.g. heap-dumps, JFR, JMX, GC log files), a user will observe smaller object sizes, but this is intentional.
    • add/remove/modify command line option
    • Implementation

      Summary

      Add an experimental flag -XX:[+|-]UseCompactObjectHeaders that enables compact object headers.

      Problem

      Compact Object Headers (JDK-8294992) implement a new, smaller object header layout, which significantly reduces memory requirements of Java applications running in the HotSpot JVM. In order to provide extra safety in the evolution of the HotSpot JVM, the new header layout should be guarded by an experimental flag, and the existing header layout retained when that flag is turned off.

      Solution

      Add an experimental flag -XX:[+|-]CompactObjectHeaders, which is off by default. By enabling the feature, users can benefit from reduced memory requirements for their Java applications. When the flag is turned off, the existing legacy header layout is used. We plan to enable the flag by default in a future release once we are sufficiently confident in its stability, feature completeness, and benefits. Eventually, in an even more distant release, the flag will get removed, together with the legacy implementation.

      Specification

      diff a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
      --- a/src/hotspot/share/runtime/globals.hpp
      +++ b/src/hotspot/share/runtime/globals.hpp
      @@ -123,14 +123,17 @@
                                                                                   \
         product(bool, UseCompressedOops, false,                                   \
                 "Use 32-bit object references in 64-bit VM. "                     \
                 "lp64_product means flag is always constant in 32 bit VM")        \
                                                                                   \
         product(bool, UseCompressedClassPointers, false,                          \
                 "Use 32-bit class pointers in 64-bit VM. "                        \
                 "lp64_product means flag is always constant in 32 bit VM")        \
                                                                                   \
      +  product(bool, UseCompactObjectHeaders, false, EXPERIMENTAL,               \
      +          "Use compact 64-bit object headers in 64-bit VM")                 \
      +                                                                            \
         product(int, ObjectAlignmentInBytes, 8,                                   \
                 "Default object alignment in bytes, 8 is minimum")                \
                 range(8, 256)                                                     \
                 constraint(ObjectAlignmentInBytesConstraintFunc, AtParse)
      

            rkennke Roman Kennke
            rkennke Roman Kennke
            Aleksey Shipilev, Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: