top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is thread dump in Java, how to take thread dump in Java?

+1 vote
373 views
What is thread dump in Java, how to take thread dump in Java?
posted Mar 30, 2016 by Abu Anam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

A thread dump is a snapshot of the state of all threads that are part of the process. The state of each thread is presented with a so called stack trace, which shows the contents of a thread's stack. Some of the threads belong to the Java application you are running, while others are JVM internal threads.

A thread dump is a list of all the Java threads that are currently active in a Java Virtual Machine (JVM).

There are several ways to take thread dumps from a JVM. It is highly recommended to take more than 1 thread dump. A good practice is to take 10 thread dumps at a regular interval (for example, one thread dump every ten seconds).

A good practice is to take 10 thread dumps at a regular interval (for example, one thread dump every ten seconds).

Step 1: Get the PID of your Java process. The first piece of information you will need to be able to obtain a thread dump is your Java process's PID. ...
Step 2: Request a thread dump from the JVM. jstack.

answer Mar 30, 2016 by Karthick.c
Similar Questions
+3 votes

I need to call this class from a background thread.

ChartPenData.main(arguments);

How can I do that?

Thread thread = new Thread();
thread = ChartPenData.main(arguments);
thread.run();
...