18 .\" |
17 .\" |
19 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
18 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 .\" or visit www.oracle.com if you need additional information or have any |
19 .\" or visit www.oracle.com if you need additional information or have any |
21 .\" questions. |
20 .\" questions. |
22 .\" |
21 .\" |
23 .\" Arch: generic |
22 .\" Automatically generated by Pandoc 2.3.1 |
24 .\" Software: JDK 8 |
|
25 .\" Date: 21 November 2013 |
|
26 .\" SectDesc: Troubleshooting Tools |
|
27 .\" Title: jstack.1 |
|
28 .\" |
23 .\" |
29 .if n .pl 99999 |
24 .TH "JSTACK" "1" "2018" "JDK 13" "JDK Commands" |
30 .TH jstack 1 "21 November 2013" "JDK 8" "Troubleshooting Tools" |
25 .hy |
31 .\" ----------------------------------------------------------------- |
26 .SH NAME |
32 .\" * Define some portability stuff |
|
33 .\" ----------------------------------------------------------------- |
|
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
35 .\" http://bugs.debian.org/507673 |
|
36 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
|
37 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
38 .ie \n(.g .ds Aq \(aq |
|
39 .el .ds Aq ' |
|
40 .\" ----------------------------------------------------------------- |
|
41 .\" * set default formatting |
|
42 .\" ----------------------------------------------------------------- |
|
43 .\" disable hyphenation |
|
44 .nh |
|
45 .\" disable justification (adjust text to left margin only) |
|
46 .ad l |
|
47 .\" ----------------------------------------------------------------- |
|
48 .\" * MAIN CONTENT STARTS HERE * |
|
49 .\" ----------------------------------------------------------------- |
|
50 |
|
51 .SH NAME |
|
52 jstack \- Prints Java thread stack traces for a Java process, core file, or remote debug server\&. This command is experimental and unsupported\&. |
|
53 .SH SYNOPSIS |
|
54 .sp |
|
55 .nf |
|
56 |
|
57 \fBjstack\fR [ \fIoptions\fR ] \fIpid\fR |
|
58 .fi |
|
59 .nf |
|
60 |
|
61 \fBjstack\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR |
|
62 .fi |
|
63 .nf |
|
64 |
|
65 \fBjstack\fR [ \fIoptions\fR ] [ \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR |
|
66 .fi |
|
67 .sp |
|
68 .TP |
|
69 \fIoptions\fR |
|
70 The command-line options\&. See Options\&. |
|
71 .TP |
|
72 \fIpid\fR |
|
73 The process ID for which the stack trace is printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&. |
|
74 .TP |
|
75 \fIexecutable\fR |
|
76 The Java executable from which the core dump was produced\&. |
|
77 .TP |
|
78 \fIcore\fR |
|
79 The core file for which the stack trace is to be printed\&. |
|
80 .TP |
|
81 \fIremote-hostname-or-IP\fR |
|
82 The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&. |
|
83 .TP |
|
84 \fIserver-id\fR |
|
85 An optional unique ID to use when multiple debug servers are running on the same remote host\&. |
|
86 .SH DESCRIPTION |
|
87 The \f3jstack\fR command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server\&. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed\&. With the \f3-m\fR option, the \f3jstack\fR command prints both Java and native frames of all threads with the program counter (PC)\&. For each native frame, the closest native symbol to PC, when available, is printed\&. C++ mangled names are not demangled\&. To demangle C++ names, the output of this command can be piped to \f3c++filt\fR\&. When the specified process is running on a 64-bit Java Virtual Machine, you might need to specify the \f3-J-d64\fR option, for example: \f3jstack -J-d64 -m pid\fR\&. |
|
88 .PP |
27 .PP |
89 \fINote:\fR This utility is unsupported and might not be available in future release of the JDK\&. In Windows Systems where the dbgeng\&.dll file is not present, Debugging Tools For Windows must be installed so these tools work\&. The \f3PATH\fR environment variable needs to contain the location of the jvm\&.dll that is used by the target process, or the location from which the crash dump file was produced\&. For example: |
28 jstack \- print Java stack traces of Java threads for a specified Java |
90 .sp |
29 process |
91 .nf |
30 .SH SYNOPSIS |
92 \f3set PATH=<jdk>\ejre\ebin\eclient;%PATH%\fP |
31 .PP |
93 .fi |
32 \f[B]Note:\f[R] This command is experimental\ and unsupported. |
94 .nf |
33 .PP |
95 \f3\fP |
34 \f[CB]jstack\f[R] [\f[I]options\f[R]] \f[I]pid\f[R] |
96 .fi |
|
97 .sp |
|
98 .SH OPTIONS |
|
99 .TP |
35 .TP |
100 -F |
36 .B \f[I]options\f[R] |
101 .br |
37 This represents the \f[CB]jstack\f[R] command\-line options. |
102 Force a stack dump when \f3jstack\fR [\f3-l\fR] \f3pid\fR does not respond\&. |
38 See \f[B]Options for the jstack Command\f[R]. |
|
39 .RS |
|
40 .RE |
103 .TP |
41 .TP |
104 -l |
42 .B \f[I]pid\f[R] |
105 .br |
43 The process ID for which the stack trace is printed. |
106 Long listing\&. Prints additional information about locks such as a list of owned \f3java\&.util\&.concurrent\fR ownable synchronizers\&. See the \f3AbstractOwnableSynchronizer\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.html |
44 The process must be a Java process. |
|
45 To get a list of Java processes running on a machine, use either the |
|
46 \f[CB]ps\f[R] command or, if the JVM processes are not running in a |
|
47 separate docker instance, the \f[B]jps\f[R] command. |
|
48 .RS |
|
49 .PP |
|
50 \f[B]Note:\f[R] JDK 10 has added support for using the Attach API when |
|
51 attaching to Java processes running in a separate docker process. |
|
52 However, the \f[CB]jps\f[R] command will not list the JVM processes that |
|
53 are running in a separate docker instance. |
|
54 If you are trying to connect a Linux host with a Virtual Machine that is |
|
55 in a docker container, you must use tools such as \f[CB]ps\f[R] to look up |
|
56 the PID of the JVM. |
|
57 .RE |
|
58 .SH DESCRIPTION |
|
59 .PP |
|
60 The \f[CB]jstack\f[R] command prints Java stack traces of Java threads for |
|
61 a specified Java process. |
|
62 For each Java frame, the full class name, method name, byte code index |
|
63 (BCI), and line number, when available, are printed. |
|
64 C++ mangled names aren\[aq]t demangled. |
|
65 To demangle C++ names, the output of this command can be piped to |
|
66 \f[CB]c++filt\f[R]. |
|
67 When the specified process is running on a 64\-bit JVM, you might need |
|
68 to specify the \f[CB]\-J\-d64\f[R] option, for example: |
|
69 \f[CB]jstack\ \-J\-d64\f[R] \f[I]pid\f[R]. |
|
70 .PP |
|
71 \f[B]Note:\f[R] |
|
72 .PP |
|
73 This command is unsupported and might not be available in future |
|
74 releases of the JDK. |
|
75 In Windows Systems where the \f[CB]dbgeng.dll\f[R] file isn\[aq]t present, |
|
76 the Debugging Tools for Windows must be installed so that these tools |
|
77 work. |
|
78 The \f[CB]PATH\f[R] environment variable needs to contain the location of |
|
79 the \f[CB]jvm.dll\f[R] that is used by the target process, or the location |
|
80 from which the core dump file was produced. |
|
81 .SH OPTIONS FOR THE JSTACK COMMAND |
107 .TP |
82 .TP |
108 -m |
83 .B \f[CB]\-l\f[R] |
109 .br |
84 The long listing option prints additional information about locks. |
110 Prints a mixed mode stack trace that has both Java and native C/C++ frames\&. |
85 .RS |
|
86 .RE |
111 .TP |
87 .TP |
112 -h |
88 .B \f[CB]\-h\f[R] or \f[CB]\-help\f[R] |
113 .br |
89 Prints a help message. |
114 Prints a help message\&. |
90 .RS |
115 .TP |
|
116 -help |
|
117 .br |
|
118 Prints a help message\&. |
|
119 .SH KNOWN\ BUGS |
|
120 In mixed mode stack trace, the \f3-m\fR option does not work with the remote debug server\&. |
|
121 .SH SEE\ ALSO |
|
122 .TP 0.2i |
|
123 \(bu |
|
124 pstack(1) |
|
125 .TP 0.2i |
|
126 \(bu |
|
127 C++filt(1) |
|
128 .TP 0.2i |
|
129 \(bu |
|
130 jps(1) |
|
131 .TP 0.2i |
|
132 \(bu |
|
133 jsadebugd(1) |
|
134 .RE |
91 .RE |
135 .br |
|
136 'pl 8.5i |
|
137 'bp |
|