JDK-8024669 : Native OOME when allocating after changes to maximum heap supporting Coops sizing on sparcv9
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-09-12
  • Updated: 2023-09-01
  • Resolved: 2013-09-18
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.
JDK 8 Other Other
8Fixed hs25Fixed hs25,openjdk7uFixed
Related Reports
Relates :  
Relates :  
Relates :  
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)
Comments
URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/9044964f9163 User: amurillo Date: 2013-09-20 22:11:15 +0000
20-09-2013

URL: http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/9044964f9163 User: tschatzl Date: 2013-09-18 15:48:58 +0000
18-09-2013

Test case for this issue is the one from JDK-8010722
17-09-2013

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.
12-09-2013

Only affects machines with > 32G of RAM as others are limited in the maximum heap by their physical memory.
12-09-2013

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)
12-09-2013