记录一次线程运用不当,Tomcat JVM崩溃产生hs_err_pid.log 解决过程

本文记录了一次由于线程滥用导致的Tomcat JVM崩溃问题,详细介绍了从发现九百多个Timer线程到定位代码错误,以及通过调整代码和优化Tomcat配置来解决问题的过程。内存不足是崩溃的主要原因,而过多的Timer线程占用大量内存是罪魁祸首。解决方案包括禁用不必要的Timer线程创建和调整Tomcat最大内存设置。
摘要由CSDN通过智能技术生成

前言

每次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
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值