Get the App
SLTechnology News&Howtos  ›  Development  › 

The specific usage of jstack command in Java

Shulou Source: shulou.com Published: 2022-06-03 11:16:48 10月26日 Update

This article mainly explains "the specific usage of jstack command in Java". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn "the specific usage of jstack command in Java" together!

1. Introduction

jstack is used to print out Java stack information for a given Java process ID or core file or Remote Debugging service. If it is on a 64-bit machine, you need to specify the option "-J-d64." Windows jstack only supports the following methods:

jstack [-l] pid

If a java program crashes to produce a core file, the jstack tool can be used to obtain information about the java stack and native stack of the core file, so that you can easily know how the java program crashed and where the program went wrong. In addition, jstack tool can also be attached to the running java program, see the java stack and native stack information of the java program running at that time, jstack is very useful if the java program running now shows hung state.

2. Command format

jstack [ option ] pid

jstack [ option ] executable core

jstack [ option ] [server-id@]remote-hostname-or-IP

3. Description of common parameters

1)options:

executable Java executable from which the core dump was produced.

(possibly java executable that generates core dump)

core dump file that will be printed information

remote-hostname-or-IP Host name or ip of remote debug service

server-id ***id, if there are multiple remote debug services on a host

2) Basic parameters:

-F Force stack information to be printed when 'jstack [-l] pid' has no corresponding

-l long list. Prints additional information about the lock, such as a list of owned synchronizers belonging to java.util.concurrent.

-m Print all stack information for java and native c/c++ frameworks.

-h |-help Print help information

pid Java process id that needs to be printed configuration information, can be queried with jps.

4. Examples of use

Thank you for reading, the above is the "Java jstack command specific usage" of the content, after the study of this article, I believe that we have a deeper understanding of the specific use of Java jstack command, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Tags: Information programs commands files learning services runs hosts contents parameters tools methods processes problems stacks multiple that is commonly used ideas situations Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia Shulou Information Apple Linux