码迷,mamicode.com
首页 > 系统相关 > 详细

linux环境JVM内存死锁问题分析

时间:2015-05-12 17:18:32      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

最近在一次压力测试问题分析中,发现运行在tomcat的应用,不管上多少个vuser模拟请求压力,只会耗用200%的cpu,测出应用的tps很低,近10次每秒。经过分析,不是网卡的瓶颈,于是怀疑是内存锁的问题,于是就以下操作与分析。

步骤一:在linux环境上执行jstack -l 线程号 >线程号.log

步骤二:从.log发现如下问题0x0000000751968760 的内存变量一个锁住,另一个在获取锁。出现死锁问题。
"http-apr-8090-exec-3898" daemon prio=10 tid=0x00007fa47e67b800 nid=0x192ac waiting for monitor entry [0x00007fa2eb978000]
   java.lang.Thread.State: BLOCKED (on object monitor)
at org.apache.log4j.Category.callAppenders(Category.java:204)
- parking to wait for  <0x0000000751968760> (a org.apache.log4j.Logger)
at org.apache.log4j.Category.forcedLog(Category.java:391)
at org.apache.log4j.Category.log(Category.java:856)
at com.xx.esi.log.logger.log4j.Log4jLogger.info(Log4jLogger.java:45)
at com.xx.esi.log.logger.support.FailsafeLogger.info(FailsafeLogger.java:119)
at com.xx.cb.web.servlet.HttpService.doPost(HttpService.java:116)



"http-apr-8090-exec-3315" daemon prio=10 tid=0x00007fa47c7f4800 nid=0x19064 runnable [0x00007fa2f608a000]
   java.lang.Thread.State: RUNNABLE
at java.util.Arrays.copyOf(Arrays.java:2367)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
at java.lang.StringBuffer.append(StringBuffer.java:237)
- locked <0x000000071fe7ee58> (a java.lang.StringBuffer)
at org.apache.log4j.helpers.PatternParser$LiteralPatternConverter.format(PatternParser.java:419)
at org.apache.log4j.PatternLayout.format(PatternLayout.java:506)
at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:310)
at org.apache.log4j.DailyRollingFileAppender.subAppend(DailyRollingFileAppender.java:369)
at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
- locked <0x0000000751d00418> (a org.apache.log4j.DailyRollingFileAppender)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
at org.apache.log4j.Category.callAppenders(Category.java:206)
- locked <0x0000000751968760> (a org.apache.log4j.Logger)
at com.xx.cb.web.servlet.HttpService.doPost(HttpService.java:116)
步骤三:解决以上代码缺陷。

linux环境JVM内存死锁问题分析

标签:

原文地址:http://blog.csdn.net/wh0426/article/details/45670213

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!