tomcat 无故挂掉?

2018-08-27 10:11:16 +08:00
 GavinJ

不同的服务器,同样一套代码,同样的 tomcat 配置。A 服务器正常 B 服务器每隔 1 天左右自动挂掉; tomcat 内存设置的也足够大了。访问用户没有几个,新部署的服务器。

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc SEVERE: The web application [/hs-service] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [FileWatchdog] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [Thread-2] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-2-1] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-3-1] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [threadDeathWatcher-4-1] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [pool-2-thread-1] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [HouseKeeper] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-3-2] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [pool-2-thread-2] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-3-3] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [pool-2-thread-3] but has failed to stop it. This is very likely to create a memory leak.

Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-3-4] but has failed to stop it. This is very likely to create a memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [pool-2-thread-4] but has failed to stop it. This is very likely to create a memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-3-5] but has failed to stop it. This is very likely to create a memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [pool-2-thread-5] but has failed to stop it. This is very likely to create a memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-3-6] but has failed to stop it. This is very likely to create a memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-3-7] but has failed to stop it. This is very likely to create a memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/hs-service] appears to have started a thread named [nioEventLoopGroup-3-8] but has failed to stop it. This is very likely to create a memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6fde19ea]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@1b51fdd1]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6b0e6e56]) and a value of type [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil.FactorySettings] (value [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil$FactorySettings@1dc8db89]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6fde19ea]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@1b0902f8]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6b0e6e56]) and a value of type [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil.FactorySettings] (value [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil$FactorySettings@154d1579]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6fde19ea]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@9f6365c]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6b0e6e56]) and a value of type [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil.FactorySettings] (value [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil$FactorySettings@52b9a078]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6fde19ea]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@1f46615]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6b0e6e56]) and a value of type [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil.FactorySettings] (value [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil$FactorySettings@7cef4d8f]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6fde19ea]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@4493d098]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6b0e6e56]) and a value of type [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil.FactorySettings] (value [com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil$FactorySettings@5b360212]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/hs-service] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@6fde19ea]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@79d003af]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Aug 26, 2018 6:43:48 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-bio-8119"] Aug 26, 2018 6:43:48 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-bio-8278"] Aug 26, 2018 6:43:48 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-bio-8119"] Aug 26, 2018 6:43:48 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-bio-8278"]

3683 次点击
所在节点    Java
22 条回复
qwx
2018-08-27 10:29:52 +08:00
你这已经是 tomcat 执行关闭时的日志了吧……
nutting
2018-08-27 11:41:24 +08:00
啥服务器,独立的还是云,虚拟机什么的
defunct9
2018-08-27 12:09:34 +08:00
开 ssh,让我上去看看
xiaoyukid
2018-08-27 12:26:00 +08:00
内存占用看看
ytmsdy
2018-08-27 12:38:13 +08:00
大概率是内存泄漏,导致内存爆掉。
看看把 tomcat 的内存设置的大一点,挂掉的时间间隔是否会增加。
如果增加了那就是内存泄漏的问题,
logicr
2018-08-27 12:40:57 +08:00
日志不是一直在说你的内存不足么
seaswalker
2018-08-27 12:56:06 +08:00
oom killer 杀掉了?
KgM4gLtF0shViDH3
2018-08-27 13:53:36 +08:00
@defunct9 每个这种问题下面都能看到你的这个回答,哈哈哈哈哈
liwl
2018-08-27 14:28:15 +08:00
开 ssh,让我上去看看
szq8014
2018-08-27 14:30:11 +08:00
mark, 你这日志不全
FrailLove
2018-08-27 14:44:46 +08:00
开 ssh,让我上去看看
asd123456cxz
2018-08-27 15:14:06 +08:00
是代码漏洞导致有内存泄漏的风险吗?字面上看是这样
woscaizi
2018-08-27 15:34:45 +08:00
感觉像是人工手动执行的 shutdown.sh
1yndonn3u
2018-08-27 16:03:48 +08:00
@defunct9 233333
idamien
2018-08-27 16:19:31 +08:00
这个应该是 tomcat 在部署 hs - service 时候有问题, 你可以重启,然后 tail - f 看看 catalina 的日志


然后 top 看看内存还有 cpu 使用情况 swap 情况

不行就接上 jmx 来看
ixiaohei
2018-08-27 16:29:10 +08:00
tomcat 8005 端口观点了么?
ixiaohei
2018-08-27 16:29:30 +08:00
关掉没有
Charkey
2018-08-27 16:31:37 +08:00
日志截取不全,看不到问题。
defunct9
2018-08-27 17:06:01 +08:00
哈哈,多了很多热心的群众,善莫大焉
southsala
2018-08-27 18:31:54 +08:00
是你机器内存足够大吧,给 tomcat 多分配点啊 大哥

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/483522

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX