thread-dump

Thread Dump Analysis Tool / Method [closed]

偶尔善良 提交于 2019-11-27 10:14:36
When the Java application is hanging, you don't even know the use case that is leading to this and want to investigate, I understand that thread dumps can be useful. But how can we easily derive useful data from the thread dumps to find where the problem is? The server application that I've been working with produces very long thread dumps, because it is an EJB architecture and thread dumps contains many container threads that I'm not sure I should be looking at (i.e. threads that are not running my application code, but JBoss's code). Yesterday I tried the Thread Dump Analyzer tool. The tool

How to analyze a java thread dump?

泄露秘密 提交于 2019-11-27 09:58:41
I am trying to understand more about java, especially about memory management and threads. For this reason I have recently found interest in looking at thread dumps. Here are few lines taken from a web app using VisualVM, a built-in tool for java: "Finalizer" daemon prio=8 tid=0x02b3d000 nid=0x898 in Object.wait() [0x02d0f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x27ef0288> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) - locked <0x27ef0288> (a java.lang.ref

Which method is the least obtrusive for generating thread dumps in java?

走远了吗. 提交于 2019-11-27 06:14:30
问题 I am aware of the following methods for generating thread dumps in java: kill -3 jstack JMX from inside the JVM JMX remote JPDA (remote) JVMTI (C API) Of these methods, which is the least detrimental to the JVM's performance? 回答1: If you just need to dump all stack traces to stdout , kill -3 and jstack should be the cheapest. The functionality is implemented natively in JVM code. No intermediate structures are created - the VM prints everything itself while it walks through the stacks. Both

How to debug Java OutOfMemory exceptions?

拟墨画扇 提交于 2019-11-27 01:10:30
问题 What is the best way to debug java.lang.OutOfMemoryError exceptions? When this happens to our application, our app server (Weblogic) generates a heap dump file. Should we use the heap dump file? Should we generate a Java thread dump? What exactly is the difference? Update: What is the best way to generate thread dumps? Is kill -3 (our app runs on Solaris) the best way to kill the app and generate a thread dump? Is there a way to generate the thread dump but not kill the app? 回答1: Analyzing

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

Thread dump programmatically /JDI (Java Debugger Interface)

点点圈 提交于 2019-11-26 20:44:47
问题 I like to generate a thread dump programmatically. I've learned that there a basically two ways to do it: Use the "Java Virtual Machine Tool Interface" JVM-TI Use the higher abstracted "Java Debugger Interface" JDI For the JVM-TI I was able to find some useful information, but I would have to write a JNI-DLL which, at least for the moment, I would like to avoid. With the JDI I can use Java and it seems I'm able to use it from within the application. But I wasn't able to find some kind of

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)

How to analyze a java thread dump?

蓝咒 提交于 2019-11-26 12:49:25
问题 I am trying to understand more about java, especially about memory management and threads. For this reason I have recently found interest in looking at thread dumps. Here are few lines taken from a web app using VisualVM, a built-in tool for java: \"Finalizer\" daemon prio=8 tid=0x02b3d000 nid=0x898 in Object.wait() [0x02d0f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x27ef0288> (a java.lang.ref.ReferenceQueue$Lock) at java

How to get a thread and heap dump of a Java process on Windows that&#39;s not running in a console

泄露秘密 提交于 2019-11-26 11:57:34
I have a Java application that I run from a console which in turn executes an another Java process. I want to get a thread/heap dump of that child process. On Unix, I could do a kill -3 <pid> but on Windows AFAIK the only way to get a thread dump is Ctrl-Break in the console. But that only gives me the dump of the parent process, not the child. Is there another way to get that heap dump? rkaganda You can use jmap to get a dump of any process running, assuming you know the pid . Use Task Manager or Resource Monitor to get the pid . Then jmap -dump:format=b,file=cheap.hprof <pid> to get the heap

How to get a thread and heap dump of a Java process on Windows that&#39;s not running in a console

眉间皱痕 提交于 2019-11-26 05:52:49
问题 I have a Java application that I run from a console which in turn executes an another Java process. I want to get a thread/heap dump of that child process. On Unix, I could do a kill -3 <pid> but on Windows AFAIK the only way to get a thread dump is Ctrl-Break in the console. But that only gives me the dump of the parent process, not the child. Is there another way to get that heap dump? 回答1: You can use jmap to get a dump of any process running, assuming you know the pid . Use Task Manager