jstack

jstack分析cpu占用100%(转)

隐身守侯 提交于 2019-11-27 06:43:45
背景: 运行测试程序后,top命令发现某个进程(pid)占用cpu达到100%。 查看哪个线程占用最多资源: ps mp pid -o THREAD,tid,命令查看这个进程下面的所有线程占用情况。 发现线程324占用最多。 使用jstack进行跟踪: jstack pid 进行查看输出到临时文件 jstack 323 > test 将刚刚发现占用cpu最多的线程id(324)换算成16进制,324==》144 查看jstack 生成的文件: 下面可以看出是哪行代码导致,查看那行代码发现有死循环。跟踪解决完毕。 上面是查看cpu占用情况,举一反三,其他的相关资源分析方法应该是类似的。 这种查起问题来很有成就感,跟我们牛牛的开发学的一招以后大家也可以用起来~~~ 后记: 测试关注的东西很多,点到面,再面到点,而开发们在技术上了解会的分析方法很多,我们在发现bug后不是直接丢给开发,fix后外围回归,而是向开发请教分析方法,得到“渔”,开发也很乐于教给我们,这样我们以后遇到类似问题就能直接进行分析,这样才能不断既提高充实自己,提高效率,并且会有很有成就感,这是一件非常快乐的事情。 from: http://testing.etao.com/node/615 来源: oschina 链接: https://my.oschina.net/u/999198/blog/129784

Jstack and Not enough storage is available to process this command

試著忘記壹切 提交于 2019-11-27 05:33:00
问题 I'm trying to run jstack command on my java application. Application is rather big, running inside jboss AS occupying about 4gb of memory. OS is Windows Server 2003 Standard edition. Every time i get an error "Not enough storage is available to process this command". There is enough ram, 16gb, and disk space. So, any ideas? 回答1: I ran into this recently on Win2008r2 and thought I'd share my solution since it took a while to figure out. Rob's comment about psexec -s is what did it for me. It

JVM性能调优监控工具jps、jstack、jmap、jhat、jstat、hprof使用详解

这一生的挚爱 提交于 2019-11-27 01:37:08
现实企业级Java开发中,有时候我们会碰到下面这些问题: OutOfMemoryError,内存不足 内存泄露 线程死锁 锁争用(Lock Contention) Java进程消耗CPU过高 ...... 这些问题在日常开发中可能被很多人忽视(比如有的人遇到上面的问题只是重启服务器或者调大内存,而不会深究问题根源),但能够理解并解决这些问题是 Java 程序员进阶的必备要求。本文将对一些常用的 JVM 性能调优监控工具进行介绍,希望能起抛砖引玉之用。本文参考了网上很多资料,难以一一列举,在此对这些资料的作者表示感谢!关于 JVM 性能调优相关的资料,请参考文末。 A 、 jps(Java Virtual Machine Process Status Tool) jps 主要用来输出 JVM 中运行的进程状态信息。语法格式如下: jps [options] [hostid]   如果不指定 hostid 就默认为当前主机或服务器。 命令行参数选项说明如下: 1 - q 不输出类名、Jar名和传入main方法的参数 2 - m 输出传入main方法的参数 3 - l 输出main类或Jar的全限名 4 -v 输出传入JVM的参数 比如下面: root@ubuntu:/# jps -m -l 2458 org.artifactory.standalone.main.Main /usr

jstack: Target process not responding

我的未来我决定 提交于 2019-11-27 00:20:30
问题 I am running Ubuntu server edition and I wanted to take a thread dump of Tomcat. So, I first tried to find out which PID tomcat uses: $ jps -l 5809 sun.tools.jps.Jps But it's not there? So, I used top instead and found out the PID 5730. Then I called jstack to get the thread dump: $ sudo jstack -l 5730 5730: Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding What's going on? :-( I already tried

Extremely simple code not working in HtmlUnit

邮差的信 提交于 2019-11-26 21:43:21
问题 I'm working with HtmlUnit 2.9 (the stable version that was released this month). Do you have any idea why the following code is not working? public class Main { public static void main(String[] args) { WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3_6); webClient.setCssEnabled(true); webClient.setCssErrorHandler(new SilentCssErrorHandler()); webClient.setThrowExceptionOnFailingStatusCode(false); webClient.setThrowExceptionOnScriptError(false); webClient.setRedirectEnabled(false);

Java thread dump: BLOCKED thread without “waiting to lock …”

吃可爱长大的小学妹 提交于 2019-11-26 20:11:51
问题 I'm having difficulties in understanding the thread dump I got from jstack for a Spring MVC web application running on Tomcat 6 (java 1.6.0_22, Linux). I see blocking threads (that cause other threads to wait) which are blocked themselves, however the thread dump doesn't tell me why or for which monitor they are waiting. Example: "TP-Processor75" daemon prio=10 tid=0x00007f3e88448800 nid=0x56f5 waiting for monitor entry [0x00000000472bc000] java.lang.Thread.State: BLOCKED (on object monitor)