JDK-8022772 : HeapWord*PSOldGen::expand_and_allocate fails
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2013-08-12
  • Updated: 2013-09-10
  • Resolved: 2013-09-10
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.
Other
hs25Resolved
Related Reports
Relates :  
Description
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 6119489536 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (/tmp/jprt/P1/162331.rbackman/s/src/os/solaris/vm/os_solaris.cpp:2797), pid=28726, tid=739
#

Stack:

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x120a60c]  void VMError::report_and_die()+0x714;;  __1cHVMErrorOreport_and_die6M_v_+0x714
V  [libjvm.so+0x706b28]  void report_vm_out_of_memory(const char*,int,unsigned long,VMErrorType,const char*)+0x68;;  __1cXreport_vm_out_of_memory6FpkciLnLVMErrorType_1_v_+0x68
V  [libjvm.so+0xef8c78]  int os::Solaris::commit_memory_impl(char*,unsigned long,bool)+0x108;;  __1cCosHSolarisScommit_memory_impl6FpcLb_i_+0x108
V  [libjvm.so+0xef8db8]  int os::Solaris::commit_memory_impl(char*,unsigned long,unsigned long,bool)+0x28;;  __1cCosHSolarisScommit_memory_impl6FpcLLb_i_+0x28
V  [libjvm.so+0xef8e78]  bool os::pd_commit_memory(char*,unsigned long,unsigned long,bool)+0x18;;  __1cCosQpd_commit_memory6FpcLLb_b_+0x18
V  [libjvm.so+0xeeb4c4]  bool os::commit_memory(char*,unsigned long,unsigned long,bool)+0x2c;;  __1cCosNcommit_memory6FpcLLb_b_+0x2c
V  [libjvm.so+0xfd4168]  bool PSVirtualSpace::expand_by(unsigned long)+0xb4;;  __1cOPSVirtualSpaceJexpand_by6ML_b_+0xb4
V  [libjvm.so+0xfa8890]  bool PSOldGen::expand_by(unsigned long)+0x60;;  __1cIPSOldGenJexpand_by6ML_b_+0x60
V  [libjvm.so+0xfa8ac4]  bool PSOldGen::expand_to_reserved()+0x7c;;  __1cIPSOldGenSexpand_to_reserved6M_b_+0x7c
V  [libjvm.so+0xfa8714]  void PSOldGen::expand(unsigned long)+0x114;;  __1cIPSOldGenGexpand6ML_v_+0x114
V  [libjvm.so+0xfa8360]  HeapWord*PSOldGen::expand_and_allocate(unsigned long)+0x28;;  __1cIPSOldGenTexpand_and_allocate6ML_pnIHeapWord__+0x28
V  [libjvm.so+0xfa8250]  HeapWord*PSOldGen::allocate(unsigned long)+0x100;;  __1cIPSOldGenIallocate6ML_pnIHeapWord__+0x100
V  [libjvm.so+0xf36a00]  HeapWord*ParallelScavengeHeap::mem_allocate(unsigned long,bool*)+0x2b8;;  __1cUParallelScavengeHeapMmem_allocate6MLpb_pnIHeapWord__+0x2b8
V  [libjvm.so+0x375b18]  HeapWord*CollectedHeap::common_mem_allocate_noinit(KlassHandle,unsigned long,Thread*)+0x228;;  __1cNCollectedHeapbAcommon_mem_allocate_noinit6FnLKlassHandle_LpnGThread__pnIHeapWord__+0x228
V  [libjvm.so+0x118d604]  typeArrayOop TypeArrayKlass::allocate_common(int,bool,Thread*)+0x49c;;  __1cOTypeArrayKlassPallocate_common6MibpnGThread__nMtypeArrayOop__+0x49c
V  [libjvm.so+0xed97e8]  typeArrayOop oopFactory::new_typeArray(BasicType,int,Thread*)+0xb8;;  __1cKoopFactoryNnew_typeArray6FnJBasicType_ipnGThread__nMtypeArrayOop__+0xb8
V  [libjvm.so+0x1024f3c]  void OptoRuntime::new_array_C(Klass*,int,JavaThread*)+0x364;;  __1cLOptoRuntimeLnew_array_C6FpnFKlass_ipnKJavaThread__v_+0x364
v  ~RuntimeStub::_new_array_Java
J  java.awt.image.DataBufferInt.<init>(II)V @ 0xffffffff713da2fc [0xffffffff713d9ce0+1564]

Comments
VM native OOM and VM exited after it failed to commit memory, lost reservation and tried again: so it's considered expected behavior. RFE JDK-8022662 has been raised to avoid additional attempts. Closed as not a bug.
10-09-2013

Ignore the noise. ************************************** It's probably a gc bug. From aurora link, the machine configuration: spb23072, Sun Sparcv9 2848 MHz, 8 cores, 18G, Solaris / Solaris 11, sun4v VM options: -d64 -server -Xcomp -XX:MaxRAMFraction=8 -XX:+CreateMinidumpOnCrash -ea -esa -XX:-TieredCompilation -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot So, the Xmx (via ergonomics) = 18G / 8 = 2.25 G = 2,304 M = 2,359,296 K = 2,415,919,104 (bytes) The failure complains we cannot "map 6,119,489,536 bytes for committing reserved memory", where the requested mapping memory (6,119,489,536 bytes) is way larger than Xmx. Looking at the stack frame and call chain in gc code. In the routine expand_to_reserved() bool PSOldGen::expand_to_reserved() { assert_lock_strong(ExpandHeap_lock); assert_locked_or_safepoint(Heap_lock); bool result = true; const size_t remaining_bytes = virtual_space()->uncommitted_size(); if (remaining_bytes > 0) { result = expand_by(remaining_bytes); DEBUG_ONLY(if (!result) warning("grow to reserve failed")); } return result; } I suspect virtual_space()->uncommitted_size() returns a bizarre value, which may be miscalculated as early as when vm starts. ************************************** Ignore the noise above.
10-09-2013

The above comment about 6GB being larger than Xms isn't correct: jvm_args: -Xcomp -XX:MaxRAMFraction=8 -XX:+CreateMinidumpOnCrash -ea -esa -XX:-TieredCompilation -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -Djava.net.preferIPv6Addresses=true -Xmx8960M -XX:ReservedCodeCacheSize=128M -XX:-PrintVMOptions -XX:+DisplayVMOutputToStderr -Xloggc:/export/local/aurora/sandbox/results/gc.log -XX:+TraceClassLoading -XX:+TraceClassUnloading -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+DisableExplicitGC
26-08-2013