In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the jstack command of Java". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use the jstack command of Java.
Introduction to jstack command
Jstack (Java Virtual Machine Stack Trace) is a command line tool provided by JDK that can generate thread snapshot information of the current moment of the Java virtual machine. Thread snapshots, commonly referred to as threaddump or javacore files, are a collection of Java threads, internal threads, and optional local method stack frames being executed by each thread in the current Java virtual machine. For each method stack frame, the full class name, method name, bytecode index (bytecode index,BCI), and line number are displayed. The generated thread snapshot can be used to locate the causes of thread pauses for a long time, such as deadlocks between threads, deadloops, requests for external resources being suspended for a long time, and so on.
Jstack command parameters
Command syntax:
Jstack [options] pid
The command parameter description:
Optional parameters for the option:jstack command. If this parameter is not specified, the jstack command displays the thread snapshot information of the current moment of the Java virtual machine, as shown in the following figure:
Pid: the process ID of the Java virtual machine to print configuration information.
To get a list of Java virtual machine processes running, you can use the ps command (on Linux systems) or the tasklist command (on Windows systems), and if the Java virtual machine processes are not running in a separate docker instance, you can use the jps command.
What are the parameters of option? Let's take a look.
-F parameter
If the Java virtual machine process does not respond because the process hangs, you can use the-F parameter (gaming on Oracle Solaris and Linux operating systems only) to force thread snapshot information to be displayed.
For example:
-l parameter
If you use the-l argument, the jstack command displays additional information about locks, such as the ownablesynchronizers list that belongs to java.util.concurrent, in addition to the method stack frame.
For example:
-m parameter
If you use the-m argument, the jstack command displays mixed stack frame information, in addition to Java method stack frames, as well as local method stack frames. The local method stack frame is virtual machine code or JNI/native code written by C or C++.
For example:
In the display result, the frame prefixed with an asterisk is the Java method stack frame, while the frame that is not prefixed with an asterisk is the local method stack frame. For example:
-h and-help
Displays help information for the jstack command.
Thank you for your reading, the above is the content of "how to use the jstack command of Java". After the study of this article, I believe you have a deeper understanding of how to use the jstack command of Java, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.