OpenJDK crash in PSPromotionManager::copy_to_survivor_space
Environment
- OpenJDK 8
Issue
The JVM process crashes with the following in the fatal error log:
# SIGSEGV (0xb) at pc=0x00007f50555973cc, pid=7856, tid=0x00007f5043ba2700
#
# JRE version: OpenJDK Runtime Environment (8.0_342-b07) (build 1.8.0_342-b07)
# Java VM: OpenJDK 64-Bit Server VM (25.342-b07 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x9b43cc] oopDesc* PSPromotionManager::copy_to_survivor_space<false>(oopDesc*)+0x70c
...
Stack: [0x00007f5043aa3000,0x00007f5043ba3000], sp=0x00007f5043ba1c30, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x9b43cc] oopDesc* PSPromotionManager::copy_to_survivor_space<false>(oopDesc*)+0x70c
V [libjvm.so+0x9b3708] PSPromotionManager::drain_stacks_depth(bool)+0x718
V [libjvm.so+0x9b771d] ThreadRootsTask::do_it(GCTaskManager*, unsigned int)+0x9d
V [libjvm.so+0x5df572] GCTaskThread::run()+0x1a2
V [libjvm.so+0x93e942] java_start(Thread*)+0xf2
...
Java Threads: ( => current thread )
...
=>0x00005611a3685800 (exited) GCTaskThread [stack: 0x00007f5043aa3000,0x00007f5043ba3000] [id=7862]
...
Event: 1.332 Executing VM operation: ParallelGCFailedAllocation
Event: 1.332 Thread 0x00005611a572a800 DEOPT PACKING pc=0x00007f5044d14923 sp=0x00007f502f960a70
Event: 1.332 Thread 0x00005611a572a800 DEOPT UNPACKING pc=0x00007f50449ab4c4 sp=0x00007f502f960958 mode 0
Event: 1.333 Thread 0x00005611a4f20800 Thread added: 0x00005611a4f20800
The fatal error log shows the G1 collector is specified, but the JVM uses the parallel collector:
Heap:
PSYoungGen total 917504K, used 786432K [0x00000007b0800000, 0x00000007f0800000, 0x00000007f0800000)
eden space 786432K, 100% used [0x00000007b0800000,0x00000007e0800000,0x00000007e0800000)
from space 131072K, 0% used [0x00000007e8800000,0x00000007e8800000,0x00000007f0800000)
to space 131072K, 4% used [0x00000007e0800000,0x00000007e0e08070,0x00000007e8800000)
ParOldGen total 2097152K, used 0K [0x0000000730800000, 0x00000007b0800000, 0x00000007b0800000)
object space 2097152K, 0% used [0x0000000730800000,0x0000000730800000,0x00000007b0800000)
...
jvm_args: --Xms3072m -Xmx3072m -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=256m -XX:+UseG1GC ...
Root Cause
The issue seems to be with allocating memory to the old space for promotion (ParallelGCFailedAllocation).
Diagnostic Steps
Test with the -XX:+AlwaysPreTouch JVM option to force the OS to wire up all the memory on startup.
Product(s)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.