V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
springGun
V2EX  ›  Java

tomcat"闪退"问题

  •  
  •   springGun · 2018-02-23 21:12:30 +08:00 · 3698 次点击
    这是一个创建于 2467 天前的主题,其中的信息可能已经有所发展或是发生改变。
    之前我有发帖询问 tomcat "闪退"问题,这个一直没得到解决 .
    昨天又重新查询了下日志,发现 tomcat 手动 shutdown 后 ,日志提示有大量线程未关闭,那么这和 tomcat"闪退"有必然关系吗?
    "闪退"指的是 tomcat ,jvm,linux 无日志提示异常.
    19 条回复    2018-02-24 14:06:38 +08:00
    fox0001
        1
    fox0001  
       2018-02-23 21:57:03 +08:00 via Android
    这个…根据你说的,没什么头绪,还是找 log 看看吧
    defunct9
        2
    defunct9  
       2018-02-23 22:27:47 +08:00
    开 ssh 我上去看看
    springGun
        3
    springGun  
    OP
       2018-02-23 22:41:10 +08:00
    @defunct9 公司内网服务
    ik
        4
    ik  
       2018-02-23 22:59:19 +08:00 via iPhone
    日志都不贴,怎么看
    rim99
        5
    rim99  
       2018-02-24 00:31:15 +08:00 via Android
    Mark 关注
    rim99
        6
    rim99  
       2018-02-24 00:33:25 +08:00 via Android
    我的 Springboot 服务有过 190 多个线程运行的情况。但是服务没有挂掉,只是接受请求很慢。20 分钟的样子。楼主这种情况没见过哇
    woscaizi
        7
    woscaizi  
       2018-02-24 07:12:13 +08:00 via iPhone
    和你的代码有关系,检查代码有没有子线程或者网络连接只有启动逻辑没有关闭逻辑。

    没有日志是不是因为日志等级高。检查 tomcat/logs/catlina.out 的内容。
    woscaizi
        8
    woscaizi  
       2018-02-24 07:13:34 +08:00 via iPhone
    @rim99 应该是 cpu 和内存占用高了,所以慢吧。htop 检查资源占用情况。
    jalja27
        9
    jalja27  
       2018-02-24 08:19:51 +08:00 via Android
    http://mp.weixin.qq.com/s/bWRW2CCHRFf7CXk7KVVrzw

    刚看到的,之前 V2EX 另一个帖子也有回复提到过这个
    shawshi
        10
    shawshi  
       2018-02-24 09:39:33 +08:00
    我以前遇到过,以及存在相应的问题
    1. jar 包冲突( logback 的日志)
    2. tomcat 启动 是否哪个任务占用过多资源过多,导致服务挂掉。
    3. 将日志级别调成 debug,分析日志慢慢找。
    pmispig
        11
    pmispig  
       2018-02-24 09:46:25 +08:00
    一般是 oom kill 了
    gam2046
        12
    gam2046  
       2018-02-24 11:07:18 +08:00
    检查一下,在退出之前是否 tomcat 占用了大量资源?如果是的话,可能是由于系统资源不足导致系统杀进程,所以 tomcat 没有任何提示。

    之前碰到过一个实习生写的,文件句柄只管开,没有关,然后跑着跑着,tomcat 就被系统杀掉了,也是没有任何提示。
    wangxiaolin
        13
    wangxiaolin  
       2018-02-24 11:16:09 +08:00
    jstack 一下
    springGun
        14
    springGun  
    OP
       2018-02-24 11:21:31 +08:00
    @ik

    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [DubboRegistryFailedRetryTimer-thread-1] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [ZkClient-EventThread-15-192.168.1.83:2181] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [localhost-startStop-1-SendThread(192.168.1.83:2181)] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [localhost-startStop-1-EventThread] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [DubboSaveRegistryCache-thread-1] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [DubboClientReconnectTimer-thread-1] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [New I/O client worker #1-1] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [dubbo-remoting-client-heartbeat-thread-1] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [DubboResponseTimeoutScanTimer] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [DubboClientReconnectTimer-thread-2] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [dubbo-remoting-client-heartbeat-thread-2] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
    springGun
        15
    springGun  
    OP
       2018-02-24 11:22:46 +08:00
    @ik

    SEVERE: The web application [/bjstqf_consoleweb] appears to have started a thread named [DubboSharedHandler-thread-1] but has failed to stop it. This is very likely to create a memory leak.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [net.sf.json.AbstractJSON.CycleSet] (value [net.sf.json.AbstractJSON$CycleSet@3bc06419]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@53ebc3f4]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [org.apache.commons.lang.builder.HashCodeBuilder$1] (value [org.apache.commons.lang.builder.HashCodeBuilder$1@1b8df337]) and a value of type [java.util.HashSet] (value [[]]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [com.alibaba.dubbo.rpc.RpcContext$1] (value [com.alibaba.dubbo.rpc.RpcContext$1@4bdf1e2f]) and a value of type [com.alibaba.dubbo.rpc.RpcContext] (value [com.alibaba.dubbo.rpc.RpcContext@2536c693]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [net.sf.json.AbstractJSON.CycleSet] (value [net.sf.json.AbstractJSON$CycleSet@3bc06419]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@2f26effb]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [org.apache.commons.lang.builder.HashCodeBuilder$1] (value [org.apache.commons.lang.builder.HashCodeBuilder$1@1b8df337]) and a value of type [java.util.HashSet] (value [[]]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [com.alibaba.dubbo.rpc.RpcContext$1] (value [com.alibaba.dubbo.rpc.RpcContext$1@4bdf1e2f]) and a value of type [com.alibaba.dubbo.rpc.RpcContext] (value [com.alibaba.dubbo.rpc.RpcContext@25555fec]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [net.sf.json.AbstractJSON.CycleSet] (value [net.sf.json.AbstractJSON$CycleSet@3bc06419]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@80c921a]) 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
    springGun
        16
    springGun  
    OP
       2018-02-24 11:23:58 +08:00
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [net.sf.json.AbstractJSON.CycleSet] (value [net.sf.json.AbstractJSON$CycleSet@3bc06419]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@49886b1f]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [net.sf.json.AbstractJSON.CycleSet] (value [net.sf.json.AbstractJSON$CycleSet@3bc06419]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1b30e5f0]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [org.apache.commons.lang.builder.HashCodeBuilder$1] (value [org.apache.commons.lang.builder.HashCodeBuilder$1@1b8df337]) and a value of type [java.util.HashSet] (value [[]]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@2747fd82]) and a value of type [com.sutong.bjstqf.entity.LogInfo] (value [com.sutong.bjstqf.entity.LogInfo@675475f3]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [com.alibaba.dubbo.rpc.RpcContext$1] (value [com.alibaba.dubbo.rpc.RpcContext$1@4bdf1e2f]) and a value of type [com.alibaba.dubbo.rpc.RpcContext] (value [com.alibaba.dubbo.rpc.RpcContext@5a0bd984]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [net.sf.json.AbstractJSON.CycleSet] (value [net.sf.json.AbstractJSON$CycleSet@3bc06419]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@3ff5974b]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [org.apache.commons.lang.builder.HashCodeBuilder$1] (value [org.apache.commons.lang.builder.HashCodeBuilder$1@1b8df337]) and a value of type [java.util.HashSet] (value [[]]) 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.
    Jan 02, 2018 9:22:56 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
    SEVERE: The web application [/bjstqf_consoleweb] created a ThreadLocal with key of type [com.alibaba.dubbo.rpc.RpcContext$1] (value [com.alibaba.dubbo.rpc.RpcContext$1@4bdf1e2f]) and a value of type [com.alibaba.dubbo.rpc.RpcContext] (value [com.alibaba.dubbo.rpc.RpcContext@149fddbb]) 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.
    qqpkat2
        17
    qqpkat2  
       2018-02-24 11:26:17 +08:00
    这不是内存问题么。。。根源找不到还怎么分析判断
    rim99
        18
    rim99  
       2018-02-24 12:29:34 +08:00 via Android
    @woscaizi 谢谢回复。检查了,不是 CPU 内存。居然是磁盘满了。然后拉取 Git 仓卡住了。
    sutra
        19
    sutra  
       2018-02-24 14:06:38 +08:00
    dmesg 看看是不是有错误信息
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3327 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 12:23 · PVG 20:23 · LAX 04:23 · JFK 07:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.