Questions tagged [thread-dump]

When debugging it becomes necessary to dump the thread state of the application, this is usually to find a deadlock, lock contention or leaking connections.

When debugging it becomes necessary to dump the thread state of the application, this is usually to find a deadlock, lock contention or leaking connections.

  • Java:
    • kill -HUP
      • stdout
      • application log file that captures stdout
    • kill -3
      • stdout
      • application log file that captures stdout
    • JDK based, the JRE does not install these programs
      • jstack > dump.txt
      • output is always to stdout, regardless of the logging configuration
      • jvisualvm
      • UI based, has many other features
221 questions
267
votes
20 answers

How to get a thread and heap dump of a Java process on Windows that's not running in a console

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 but on Windows AFAIK the only way to get a thread dump is…
macgreg
132
votes
10 answers

kill -3 to get java thread dump

I am using kill -3 command to see the JVM's thread dump in unix. But where can I find the output of this kill command? I am lost!!
javanerd
  • 2,802
  • 4
  • 24
  • 32
106
votes
2 answers

How to analyze a java thread dump?

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…
Leonardo
  • 9,607
  • 17
  • 49
  • 89
66
votes
5 answers

Difference between javacore, thread dump and heap dump in Websphere

Can someone tell me the exact difference between javacore, thread dump and heap dump? Under which situation each of these are used??
Sargunan
65
votes
3 answers

Thread Dump Analysis Tool / Method

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…
Ivo Rossi
  • 785
  • 1
  • 6
  • 7
51
votes
10 answers

jstack: Target process not responding

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…
Timo Ernst
  • 15,243
  • 23
  • 104
  • 165
50
votes
2 answers

Java thread dump: Difference between "waiting to lock" and "parking to wait for"?

In a Java thread dump, you can see locks mentioned within stack traces. There seems to be three kinds of information: 1: - locked <0x00002aab329f7fa0> (a java.io.BufferedInputStream) 2: - waiting to lock <0x00002aaaf4ff6fa0> (a…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
31
votes
3 answers

What is "Locked ownable synchronizers" in thread dump?

I am trying to understand what does Locked ownable synchronizers refer to in a thread dump? I started using ReentrantReadWriteLock have a thread in WAITING state, waiting for a ReentrantReadWriteLock$FairSync in the "locked ownable synchronizers"…
Matthieu
  • 2,736
  • 4
  • 57
  • 87
31
votes
2 answers

How to find out which thread holds the monitor?

My application is using Gson 2.2 for converting POJOs to JSON. When I was making a load test I stumbled upon a lot of threads blocked in Gson constructor: "http-apr-28201-exec-28" #370 daemon prio=5 os_prio=0 tid=0x0000000001ee7800 nid=0x62cb…
bedrin
  • 4,458
  • 32
  • 53
28
votes
5 answers

Tomcat thread dump

Is there away to take a thread dump from Tomcat? I would like to monitor the threads running in Tomcat at a certain point in time. Note: I was doing that on Web logic but i don't know how it can be done on Tomcat.
Abdullah
  • 401
  • 2
  • 7
  • 15
25
votes
3 answers

Understanding the Reference Handler thread

I am continuing my path to deep understanding of Java Thread. Unfortunately my Java Certification didn't cover that part, so the only way of learning is to post a series of dumb questions. With so many years of Java Development, I am sometimes…
Leonardo
  • 9,607
  • 17
  • 49
  • 89
24
votes
4 answers

Java thread dump: BLOCKED thread without "waiting to lock ..."

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…
Oliver
  • 361
  • 1
  • 2
  • 6
23
votes
4 answers

Taking thread dumps in production

I am analyzing the differences between approaches for taking thread dumps. Below are the couple of them I am researching on Defining a jmx bean which triggers jstack through Runtime.exec() on clicking a declared bean operation. Daemon thread…
Andy Dufresne
  • 6,022
  • 7
  • 63
  • 113
21
votes
2 answers

How do I make a thread dump with MONO?

How can I show the threads (stacktraces) in a hanging application that run with MONO? I know that I can do it in .NET with the Managed Stack Explorer (MSE). Because the application hang only with MONO that I need to do it with MONO. Or there are…
Horcrux7
  • 23,758
  • 21
  • 98
  • 156
20
votes
8 answers

How to debug Java OutOfMemory exceptions?

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…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
1
2 3
14 15