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

ObjectAlignmentInBytes=16 now forces the use of heap based compressed oops

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • hs25
    • hs25
    • hotspot
    • b18
    • b47

        When ObjectAlignmentInBytes=16 is specified we now get heap based compressed oops instead of zero based compressed oops, even when we specify a really small heap size.

        In build JDK8-b76 (hs25-b17) both these command lines gave zero based compressed oops:

        /localhome/java/jdk-8-ea-bin-b76/bin/java -XX:ObjectAlignmentInBytes=8 -Xmx32m -XX:ClassMetaspaceSize=32m -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -version
        heap address: 0x00000000fe000000, size: 32 MB, zero based Compressed Oops, 32-bits Oops

        $ /localhome/java/jdk-8-ea-bin-b76/bin/java -XX:ObjectAlignmentInBytes=16 -Xmx32m -XX:ClassMetaspaceSize=32m -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -version
        heap address: 0x00000000fe000000, size: 32 MB, zero based Compressed Oops, 32-bits Oops

        In build JDK8-b77 (hs25-b18) we get the following:

        $ /localhome/java/jdk-8-ea-bin-b77/bin/java -XX:ObjectAlignmentInBytes=8 -Xmx32m -XX:ClassMetaspaceSize=32m -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -version

        heap address: 0x00000000fe000000, size: 32 MB, zero based Compressed Oops, 32-bits Oops

        /localhome/java/jdk-8-ea-bin-b77/bin/java -XX:ObjectAlignmentInBytes=16 -Xmx32m -XX:ClassMetaspaceSize=32m -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -version

        heap address: 0x0000000800000000, size: 32 MB, Compressed Oops with base: 0x00000007fdfff000


        The problem is that the narrow shift for oops is 4 while the narrow shift for Klasses is 3. Because of this, the following if statement because OopEncodingHeapMax is 64GB while KlassEncodingMetaspaceMax is 32 GB.

              } else if ((total_size <= OopEncodingHeapMax) && (mode != HeapBasedNarrowOop) &&
                  (!UseCompressedKlassPointers ||
                    (((OopEncodingHeapMax - heap_size) + Universe::class_metaspace_size()) <= KlassEncodingMetaspaceMax))) {

        ILW = LHM -> P4
        I: L
        L: H
        W: M

              hseigel Harold Seigel (Inactive)
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: