JRE: There is insufficient memory for the Java Runtime Environment to continue

Viewed 115

I am running a Java application in a Linux Server with 32GB of memory and suddenly the application stopped working and returned this error in a log file. At the moment of the exception there was still about 25GB of memory available.

These were the details at the moment of the crash:

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 12288 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
#   JVM is running with Zero Based Compressed Oops mode in which the Java heap is
#     placed in the first 32GB address space. The Java Heap base address is the
#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress
#     to set the Java Heap base and to place the Java Heap above 32GB virtual address.
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2798), pid=505585, tid=0x00007f80491d7640
#
# JRE version: OpenJDK Runtime Environment (8.0_342-b07) (build 1.8.0_342-8u342-b07-0ubuntu1~22.04-b07)
# Java VM: OpenJDK 64-Bit Server VM (25.342-b07 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

Memory: 4k page, physical 32875188k(25987732k free), swap 0k(0k free)

vm_info: OpenJDK 64-Bit Server VM (25.342-b07) for linux-amd64 JRE (1.8.0_342-8u342-b07-0ubuntu1~22.04-b07), built on Jul 23 2022 16:13:07 by "buildd" with gcc 11.2.0

This message contains some possible solutions. But instead of trying each one of those solutions and cross my fingers for it to no happen again, I need to determine the exact reason why this OutOfMemory happened, try to reproduce it again and apply the correct solution.

I am starting an Apache Felix instance and the command line I use to start the java app is:

java -Dorg.osgi.framework.bootdelegation=sun.*,com.sun.* -Dfile.encoding=UTF-8 -jar bin/felix.jar &
0 Answers
Related