错误
错误如下,JRE内存不足。

解决方案
查看上述文件:
# 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.
首先查看服务器的内存肯定是够的,因此尝试减小了Java堆的大小,在/etc/profile文件中添加JAVA_OPTS
export JAVA_OPTS="$JAVA_OPTS -Xms1024m -Xmx1024m -Xss1024K -XX:PermSize=128m -XX:MaxPermSize=256m"
JAVA堆默认分配的最大内存为系统内存的1/4,我服务器内存32G,因此默认32/4=8G。现在为Java 堆分配的内存变成1G,问题解决。
本文详细解析了JRE内存不足的多种可能原因,包括物理内存不足、Java堆内存设置不当等,并提供了调整Java堆大小、减少Java线程数及栈大小等解决方案,成功将服务器内存使用从默认的8G降低至1G,有效解决了内存溢出问题。

7944

被折叠的 条评论
为什么被折叠?



