Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java stack dump on windows

Tags:

java

windows

I have a running java process in a standard windows command window. ie i have run 'cmd' and typed in java -jar ...

I need to be able to get a full stack dump of all threads if at all possible.

i remember that under linux you can send a message to the JVM via an option on the quit command.

in this document sun state

To generate a stack trace on Windows 95, or Windows NT platforms, enter the key sequence in the window where the Java program is running, or click the Close button on the window.

this is clearly wrong, as closing the terminal does nothing but kill the process and close the window.

like image 223
pstanton Avatar asked Jan 23 '10 20:01

pstanton


People also ask

Where is Jstack located?

There are 3 main processes that will be running when Analyze is up that we can get the jstack for: The web application server (Tomcat) The Analyze server. The node container.

How do you take heap dump in Java?

The JDK comes with several tools to capture heap dumps in different ways. All these tools are located under the bin folder inside the JDK home directory. Therefore, we can start them from the command line as long as this directory is included in the system path.


1 Answers

You can use jstack [ option ] pid (if the question is about thread dump). Use jps to find the id of your Java process.

like image 53
Pascal Thivent Avatar answered Sep 22 '22 19:09

Pascal Thivent