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

Native OOME when allocating after changes to maximum heap supporting Coops sizing on sparcv9

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: hs25
    • Component/s: hotspot
    • Subcomponent:
      gc
    • Resolved In Build:
      b51
    • Verification:
      Not verified

      Backports

        Description

        After JDK-8010722 the maximum heap allowed for supporting COOPs changed. In case of sparcv9, instead of Coops with base address the VM now is able to use zero base compressed oops.

        I.e. the VM successfully maps the heap at 4G+4M (4M being the max large page size); however on sparcv9 the default base address for the application image is at 4G too. Since the malloc() heap always starts after the application image, there is very little room for it, leading to OOME.

        E.g. with the changes in JDK-8010722 the maximum heap supporting Coops is now 28668 MB instead of 28672 MB. This difference is enough to cause this issue. Previously the VM used coops with base address instead of zero based oops (wrongly), so this did not trigger.

        It also only triggers on machines with >= 32G of physical memory.

        Note that the same issue can be reproduced by manually setting the heap to 28668 MB using -Xmx.

        This has only been seen on solaris-sparcv9.

        Workaround:
         - specify maximum heap size that is reasonably low (-Xmx) or larger than the value above (e.g. outside of (OopEncodingHeapMax - HeapBaseMinAddress - X, OopEncodingHeapMax - HeapBaseMinAddress).
         - set LargePageSizeInBytes to something high (e.g. 1G) - this also increases the available C heap
         - set heap base minimum address to something > 4G (e.g. 6G to get 2G C heap)

        P2: high impact (practically guaranteed OOME), occurrence medium (needs machine with >= 32G, special -Xmx settings), workaround simple (HHL)

          Issue Links

            Activity

            Hide
            tschatzl Thomas Schatzl added a comment -
            Output of VM startup after JDK-8010722:

            in/java -d64 -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -version

            heap address: 0x0000000100400000, size: 28668 MB, zero based Compressed Oops

            Narrow klass base: 0x0000000800000000, Narrow klass shift: 0
            Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr: 0x0000000800000000
            #
            # There is insufficient memory for the Java Runtime Environment to continue.
            # Native memory allocation (malloc) failed to allocate 4128 bytes for AllocateHeap
            # An error report file with more information is saved as:
            # ...hs_err_pid8060.log

            pmap:
            000000100000000 8K r-x-- /.../solaris-sparcv9/bin/sparcv9/java
            0000000100100000 8K rwx-- /.../solaris-sparcv9/bin/sparcv9/java
            0000000100102000 56K rwx-- [ heap ]
            0000000100110000 3008K rwx-- [ heap ]
            0000000100400000 1392640K rw--- [ anon ]
            00000005AAC00000 696320K rw--- [ anon ]
            0000000800000000 4096K rw--- [ anon ]

            Output of VM startup before JDK-8010722:

            $solaris-sparcv9/bin/java -d64 -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -version

            Protected page at the reserved heap base: 0xfffffff800000000 / 4194304 bytes

            heap address: 0xfffffff800400000, size: 28672 MB, Compressed Oops with base: 0xfffffff8003fe000

            Narrow klass base: 0x0000000800000000, Narrow klass shift: 0
            Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr: 0x0000000800000000
            java version "1.8.0-ea"
            Java(TM) SE Runtime Environment (build 1.8.0-ea-b107)
            Java HotSpot(TM) 64-Bit Server VM (build 25.0-b49, mixed mode)

            a (successful) run with LargePageSizeInBytes=1G

            $ /.../solaris-sparcv9/bin/java -d64 -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -XX:+ShowMessageBoxOnError -XX:+UseSerialGC -XX:LargePageSizeInBytes=1G -version

            heap address: 0x0000000110000000, size: 28416 MB, zero based Compressed Oops

            Narrow klass base: 0x0000000800000000, Narrow klass shift: 0
            Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr: 0x0000000800000000
            java version "1.8.0-ea-fastdebug"
            Java(TM) SE Runtime Environment (build 1.8.0-ea-fastdebug-b106)
            Java HotSpot(TM) 64-Bit Server VM (build 25.0-b50-internal-201309111427.thomas.src-fastdebug, mixed mode)

            Show
            tschatzl Thomas Schatzl added a comment - Output of VM startup after JDK-8010722 : in/java -d64 -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -version heap address: 0x0000000100400000, size: 28668 MB, zero based Compressed Oops Narrow klass base: 0x0000000800000000, Narrow klass shift: 0 Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr: 0x0000000800000000 # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (malloc) failed to allocate 4128 bytes for AllocateHeap # An error report file with more information is saved as: # ...hs_err_pid8060.log pmap: 000000100000000 8K r-x-- /.../solaris-sparcv9/bin/sparcv9/java 0000000100100000 8K rwx-- /.../solaris-sparcv9/bin/sparcv9/java 0000000100102000 56K rwx-- [ heap ] 0000000100110000 3008K rwx-- [ heap ] 0000000100400000 1392640K rw--- [ anon ] 00000005AAC00000 696320K rw--- [ anon ] 0000000800000000 4096K rw--- [ anon ] Output of VM startup before JDK-8010722 : $solaris-sparcv9/bin/java -d64 -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -version Protected page at the reserved heap base: 0xfffffff800000000 / 4194304 bytes heap address: 0xfffffff800400000, size: 28672 MB, Compressed Oops with base: 0xfffffff8003fe000 Narrow klass base: 0x0000000800000000, Narrow klass shift: 0 Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr: 0x0000000800000000 java version "1.8.0-ea" Java(TM) SE Runtime Environment (build 1.8.0-ea-b107) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b49, mixed mode) a (successful) run with LargePageSizeInBytes=1G $ /.../solaris-sparcv9/bin/java -d64 -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompressedOopsMode -XX:+ShowMessageBoxOnError -XX:+UseSerialGC -XX:LargePageSizeInBytes=1G -version heap address: 0x0000000110000000, size: 28416 MB, zero based Compressed Oops Narrow klass base: 0x0000000800000000, Narrow klass shift: 0 Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr: 0x0000000800000000 java version "1.8.0-ea-fastdebug" Java(TM) SE Runtime Environment (build 1.8.0-ea-fastdebug-b106) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b50-internal-201309111427.thomas.src-fastdebug, mixed mode)
            Hide
            tschatzl Thomas Schatzl added a comment -
            Only affects machines with > 32G of RAM as others are limited in the maximum heap by their physical memory.
            Show
            tschatzl Thomas Schatzl added a comment - Only affects machines with > 32G of RAM as others are limited in the maximum heap by their physical memory.
            Hide
            tschatzl Thomas Schatzl added a comment -
            There're more strange things going on with COOP sizing:

            E.g.

            bin/java -d64 -XX:+UnlockDiagnosticVMOptions -XX:
            +PrintCompressedOopsMode -Xmx28664M -XX:HeapBaseMinAddress=4G -version

            Protected page at the reserved heap base: 0xfffffff280000000 / 4194304
            bytes

            heap address: 0xfffffff280400000, size: 28664 MB, Compressed Oops with
            base: 0xfffffff2803fe000

            Narrow klass base: 0x0000000800000000, Narrow klass shift: 0
            Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr:
            0x0000000800000000
            java version "1.8.0-ea-fastdebug"
            Java(TM) SE Runtime Environment (build 1.8.0-ea-fastdebug-b106)
            Java HotSpot(TM) 64-Bit Server VM (build
            25.0-b50-internal-201309111427.thomas.src-fastdebug, mixed mode)

            But (notice the absence of HeapBaseMinAddress; its default value is 4G
            in this VM):

            $ bin/java -d64 -XX:+UnlockDiagnosticVMOptions -XX:
            +PrintCompressedOopsMode -Xmx28664M -version
            heap address: 0x0000000100800000, size: 28664 MB, zero based Compressed
            Oops

            Narrow klass base: 0x0000000800000000, Narrow klass shift: 0
            Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr:
            0x0000000800000000
            java version "1.8.0-ea-fastdebug"
            Java(TM) SE Runtime Environment (build 1.8.0-ea-fastdebug-b106)
            Java HotSpot(TM) 64-Bit Server VM (build
            25.0-b50-internal-201309111427.thomas.src-fastdebug, mixed mode)

            E.g. depending on whether HeapBaseMinAddress is set (even to the default value) you get a different COOP mode.

            Show
            tschatzl Thomas Schatzl added a comment - There're more strange things going on with COOP sizing: E.g. bin/java -d64 -XX:+UnlockDiagnosticVMOptions -XX: +PrintCompressedOopsMode -Xmx28664M -XX:HeapBaseMinAddress=4G -version Protected page at the reserved heap base: 0xfffffff280000000 / 4194304 bytes heap address: 0xfffffff280400000, size: 28664 MB, Compressed Oops with base: 0xfffffff2803fe000 Narrow klass base: 0x0000000800000000, Narrow klass shift: 0 Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr: 0x0000000800000000 java version "1.8.0-ea-fastdebug" Java(TM) SE Runtime Environment (build 1.8.0-ea-fastdebug-b106) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b50-internal-201309111427.thomas.src-fastdebug, mixed mode) But (notice the absence of HeapBaseMinAddress; its default value is 4G in this VM): $ bin/java -d64 -XX:+UnlockDiagnosticVMOptions -XX: +PrintCompressedOopsMode -Xmx28664M -version heap address: 0x0000000100800000, size: 28664 MB, zero based Compressed Oops Narrow klass base: 0x0000000800000000, Narrow klass shift: 0 Metaspace Size: 1073741824 Address: 0x0000000800000000 Req Addr: 0x0000000800000000 java version "1.8.0-ea-fastdebug" Java(TM) SE Runtime Environment (build 1.8.0-ea-fastdebug-b106) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b50-internal-201309111427.thomas.src-fastdebug, mixed mode) E.g. depending on whether HeapBaseMinAddress is set (even to the default value) you get a different COOP mode.
            Hide
            tschatzl Thomas Schatzl added a comment -
            Test case for this issue is the one from JDK-8010722
            Show
            tschatzl Thomas Schatzl added a comment - Test case for this issue is the one from JDK-8010722
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/9044964f9163
            User: tschatzl
            Date: 2013-09-18 15:48:58 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/9044964f9163 User: tschatzl Date: 2013-09-18 15:48:58 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/9044964f9163
            User: amurillo
            Date: 2013-09-20 22:11:15 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/9044964f9163 User: amurillo Date: 2013-09-20 22:11:15 +0000

              People

              • Assignee:
                tschatzl Thomas Schatzl
                Reporter:
                tschatzl Thomas Schatzl
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: