blob: 9db29654f9e3a0344126edbd89d15b26e47eef25 [file] [log] [blame]
mfangfbb44202015-06-25 16:46:26 -07001'\" t
2.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
rgallardb6435452013-11-25 20:19:02 -08003.\" 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.\"
mfangfbb44202015-06-25 16:46:26 -070023.\" 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"
rgallardb6435452013-11-25 20:19:02 -080031.\" -----------------------------------------------------------------
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.\" -----------------------------------------------------------------
mfangfbb44202015-06-25 16:46:26 -070050
51.SH NAME
52jhat \- 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
62The command-line options\&. See Options\&.
63.TP
64\fIheap-dump-file\fR
65Java 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
67The \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
69There are several ways to generate a Java heap dump:
70.TP 0.2i
71\(bu
72Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
73.TP 0.2i
74\(bu
75Use 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
78Heap 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
81Use 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
86Turns 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
90Turns 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
94Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
95.TP
96-exclude \fIexclude-file\fR
97.br
98Specifies 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
102Specifies 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
106Sets 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
110Reports the release number and exits
111.TP
112-h
113.br
114Dsiplays a help message and exits\&.
115.TP
116-help
117.br
118Displays a help message and exits\&.
119.TP
120-J\fIflag\fR
121.br
122Passes \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
126jmap(1)
127.TP 0.2i
128\(bu
129jconsole(1)
130.TP 0.2i
131\(bu
132HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
rgallardb6435452013-11-25 20:19:02 -0800133.RE
134.br
135'pl 8.5i
136'bp