我的Tomcat服务器已经运行了好几天,但是我无法正常关闭它,因为在执行时shutdown.sh,我收到了这个错误:
# root@iZ94hjppdqzZ:~/projects/taolijie# cat hs_err_pid5519.log
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1073741824 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 (os_linux.cpp:2673), pid=5519, tid=3061726064
#
# JRE version: (8.0_45-b14) (build )
# Java VM: Java HotSpot(TM) Server VM (25.45-b02 mixed mode linux-x86 )
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
Run Code Online (Sandbox Code Playgroud)
因此我必须杀死Tomcat才能将其关闭.但奇怪的是,当生成此错误时,Tomcat正常工作(它可以正常处理Web请求).
以下是VM选项:
-server -Xms1G -Xmx1G -XX:+UseG1GC
Run Code Online (Sandbox Code Playgroud)
我的服务器有2GB内存.谁能弄明白发生了什么?谢谢!!
这看起来像是通过以下方式设置内存配置:
JAVA_OPTS="-server -Xms1G -Xmx1G -XX:+UseG1GC"
Run Code Online (Sandbox Code Playgroud)
在JAVA_OPTS环境变量用于所有Tomcat的Java进程的,诸如用于发送关机消息之一.
您需要确定通过设置以下内容来配置Tomcat内存:
CATALINA_OPTS="-server -Xms1G -Xmx1G -XX:+UseG1GC"
Run Code Online (Sandbox Code Playgroud)
然后,此设置将仅应用于Tomcat进程.其他控制进程将使用默认内存设置执行正常.
| 归档时间: |
|
| 查看次数: |
1796 次 |
| 最近记录: |