|
1 '\" t |
|
2 .\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. |
|
3 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 .\" |
|
5 .\" This code is free software; you can redistribute it and/or modify it |
|
6 .\" under the terms of the GNU General Public License version 2 only, as |
|
7 .\" published by the Free Software Foundation. |
|
8 .\" |
|
9 .\" This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 .\" version 2 for more details (a copy is included in the LICENSE file that |
|
13 .\" accompanied this code). |
|
14 .\" |
|
15 .\" You should have received a copy of the GNU General Public License version |
|
16 .\" 2 along with this work; if not, write to the Free Software Foundation, |
|
17 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 .\" |
|
19 .\" 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 |
|
21 .\" questions. |
|
22 .\" |
|
23 .\" Arch: generic |
|
24 .\" Software: JDK 8 |
|
25 .\" Date: 21 November 2013 |
|
26 .\" SectDesc: Troubleshooting Tools |
|
27 .\" Title: jhat.1 |
|
28 .\" |
|
29 .if n .pl 99999 |
|
30 .TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools" |
|
31 .\" ----------------------------------------------------------------- |
|
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 jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&. |
|
53 .SH SYNOPSIS |
|
54 .sp |
|
55 .nf |
|
56 |
|
57 \fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR |
|
58 .fi |
|
59 .sp |
|
60 .TP |
|
61 \fIoptions\fR |
|
62 The command-line options\&. See Options\&. |
|
63 .TP |
|
64 \fIheap-dump-file\fR |
|
65 Java binary heap dump file to be browsed\&. For a dump file that contains multiple heap dumps, you can specify which dump in the file by appending \f3#<number>\fR to the file name, for example, \f3myfile\&.hprof#3\fR\&. |
|
66 .SH DESCRIPTION |
|
67 The \f3jhat\fR command parses a Java heap dump file and starts a web server\&. The \f3jhat\fR command lets you to browse heap dumps with your favorite web browser\&. The \f3jhat\fR command supports predesigned queries such as show all instances of a known class \f3MyClass\fR, and Object Query Language (OQL)\&. OQL is similar to SQL, except for querying heap dumps\&. Help on OQL is available from the OQL help page shown by the \f3jhat\fR command\&. With the default port, OQL help is available at http://localhost:7000/oqlhelp/ |
|
68 .PP |
|
69 There are several ways to generate a Java heap dump: |
|
70 .TP 0.2i |
|
71 \(bu |
|
72 Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&. |
|
73 .TP 0.2i |
|
74 \(bu |
|
75 Use the \f3jconsole\fR option to obtain a heap dump through \f3HotSpotDiagnosticMXBean\fR at runtime\&. See jconsole(1) and the \f3HotSpotDiagnosticMXBean\fR interface description at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html |
|
76 .TP 0.2i |
|
77 \(bu |
|
78 Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&. |
|
79 .TP 0.2i |
|
80 \(bu |
|
81 Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html |
|
82 .SH OPTIONS |
|
83 .TP |
|
84 -stack false|true |
|
85 .br |
|
86 Turns off tracking object allocation call stack\&. If allocation site information is not available in the heap dump, then you have to set this flag to \f3false\fR\&. The default is \f3true\fR\&. |
|
87 .TP |
|
88 -refs false|true |
|
89 .br |
|
90 Turns off tracking of references to objects\&. Default is \f3true\fR\&. By default, back pointers, which are objects that point to a specified object such as referrers or incoming references, are calculated for all objects in the heap\&. |
|
91 .TP |
|
92 -port \fIport-number\fR |
|
93 .br |
|
94 Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&. |
|
95 .TP |
|
96 -exclude \fIexclude-file\fR |
|
97 .br |
|
98 Specifies a file that lists data members that should be excluded from the reachable objects query\&. For example, if the file lists \f3java\&.lang\&.String\&.value\fR, then, then whenever the list of objects that are reachable from a specific object \f3o\fR are calculated, reference paths that involve \f3java\&.lang\&.String\&.value\fR field are not considered\&. |
|
99 .TP |
|
100 -baseline \fIexclude-file\fR |
|
101 .br |
|
102 Specifies a baseline heap dump\&. Objects in both heap dumps with the same object ID are marked as not being new\&. Other objects are marked as new\&. This is useful for comparing two different heap dumps\&. |
|
103 .TP |
|
104 -debug \fIint\fR |
|
105 .br |
|
106 Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&. |
|
107 .TP |
|
108 -version |
|
109 .br |
|
110 Reports the release number and exits |
|
111 .TP |
|
112 -h |
|
113 .br |
|
114 Dsiplays a help message and exits\&. |
|
115 .TP |
|
116 -help |
|
117 .br |
|
118 Displays a help message and exits\&. |
|
119 .TP |
|
120 -J\fIflag\fR |
|
121 .br |
|
122 Passes \f3flag\fR to the Java Virtual Machine on which the \f3jhat\fR command is running\&. For example, \f3-J-Xmx512m\fR to use a maximum heap size of 512 MB\&. |
|
123 .SH SEE\ ALSO |
|
124 .TP 0.2i |
|
125 \(bu |
|
126 jmap(1) |
|
127 .TP 0.2i |
|
128 \(bu |
|
129 jconsole(1) |
|
130 .TP 0.2i |
|
131 \(bu |
|
132 HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html |
|
133 .RE |
|
134 .br |
|
135 'pl 8.5i |
|
136 'bp |