前言
每次tomcat在客户服务器上运行一个多月左右的时候,都会崩溃。然后tomcat自动停止,生成hs_err_pid.log文件。
说明
因为在原来服务器上就出现了tomcat崩溃,也不知道因为什么原因崩溃,多长时间崩溃。而且也没注意有pid.log文件,只是进行重启操作。后来还跑过去换服务器,重新进行部署。但是还是会崩溃,这次注意到pid.log文件,然后进行分析,一直找不到解决的原因。
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 533160 bytes for Chunk::new
# 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:ReservedCo