Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The specific usage of jstack command in Java

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report