Tomcat启动时报错This is very likely to create a memory leak. Stack trace of thread

问题描述

Web项目本地运行正常,部署到服务器Tomcat启动后访问404。
查看日志发现启动时报错:This is very likely to create a memory leak. Stack trace of thread

原因

内存溢出。Tomcat默认内存为128M,不足。

解决方案

在catalina.sh中配置JVM参数:

# -Xms128m 初始堆大小,建议为内存的1/64
# -Xmx512m 最大堆大小,建议为内存的1/4
JAVA_OPTS= -Xms128m -Xmx512m

重启Tomcat,解决

参考https://blog.csdn.net/hehuanchun0311/article/details/80506176

你可能感兴趣的:(Tomcat启动时报错This is very likely to create a memory leak. Stack trace of thread)