zoukankan      html  css  js  c++  java
  • 事故分析

      

    先dump内存看看。

    将网关层应用的内存dump下来后,发现了问题: 

    "qtp1056944384-232" prio=10 tid=0x00007f54900d0800 nid=0x63b3 waiting for monitor entry [0x00007f54492d0000]
       java.lang.Thread.State: BLOCKED (on object monitor)
    	at org.apache.log4j.Category.callAppenders(Category.java:205)
    	- waiting to lock <0x00000007e81c4830> (a org.apache.log4j.spi.RootLogger)
    	at org.apache.log4j.Category.forcedLog(Category.java:391)
    	at org.apache.log4j.Category.log(Category.java:856)
    	at org.slf4j.impl.Log4jLoggerAdapter.info(Log4jLoggerAdapter.java:368)
    

     总计有200多个log4j的线程在等待锁"0x00000007e81c4830",而这把锁被谁持有呢?通过搜索,找到以下dump信息:

    "qtp1056944384-218" prio=10 tid=0x00007f54800bb800 nid=0x63a5 runnable [0x00007f544a0de000]
       java.lang.Thread.State: RUNNABLE
    	at java.net.SocketOutputStream.socketWrite0(Native Method)
    	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    	at java.net.SocketOutputStream.write(SocketOutputStream.java:141)
    	at net.logstash.log4j.SocketAppender.append(SocketAppender.java:190)
    	at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
    	- locked <0x00000007e8210868> (a net.logstash.log4j.SocketAppender)
    	at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
    	at org.apache.log4j.Category.callAppenders(Category.java:206)
    	- locked <0x00000007e81c4830> (a org.apache.log4j.spi.RootLogger)
    	at org.apache.log4j.Category.forcedLog(Category.java:391)
    	at org.apache.log4j.Category.log(Category.java:856)
    	at org.slf4j.impl.Log4jLoggerAdapter.info(Log4jLoggerAdapter.java:368)
    

     第218号线程持有了锁"0x00000007e81c4830",然后其它log4j的线程都在等待这把锁的释放

    http://www.cnblogs.com/suxuan/p/5041420.html

    --希望是生命的瑰丽朝霞,我们应当在希望中生活,并在希望中奋进,去开拓我们的人生之路。
  • 相关阅读:
    Java读取压缩文件信息
    中国菜刀 一句话木马
    java中equals方法和hashcode方法的区别和联系,以及为什么要重写这两个方法,不重写会怎样
    Hadoop搭建全程
    instr模糊查询使用及注意事项
    idea离线安装SonarLint
    Previous operation has not finished; run 'cleanup' if it was interrupted] 的排错过程
    vue中excel文件上传总结
    IDEA 2019.1离线安装lombok
    @Data注解失效解决办法
  • 原文地址:https://www.cnblogs.com/nulisaonian/p/6053227.html
Copyright © 2011-2022 走看看