blob: c53dc0fce38a947080f5d869b2bd2a6b6de5055a [file] [log] [blame]
rgallardb6435452013-11-25 20:19:02 -08001'\" t
2.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
3.\"
4.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5.\"
6.\" This code is free software; you can redistribute it and/or modify it
7.\" under the terms of the GNU General Public License version 2 only, as
8.\" published by the Free Software Foundation.
9.\"
10.\" This code is distributed in the hope that it will be useful, but WITHOUT
11.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13.\" version 2 for more details (a copy is included in the LICENSE file that
14.\" accompanied this code).
15.\"
16.\" You should have received a copy of the GNU General Public License version
17.\" 2 along with this work; if not, write to the Free Software Foundation,
18.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19.\"
20.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21.\" or visit www.oracle.com if you need additional information or have any
22.\" questions.
23.\"
24.\" Arch: generic
25.\" Software: JDK 8
26.\" Date: 21 November 2013
27.\" SectDesc: Troubleshooting Tools
28.\" Title: jhat.1
29.\"
30.if n .pl 99999
31.TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
32.\" -----------------------------------------------------------------
33.\" * Define some portability stuff
34.\" -----------------------------------------------------------------
35.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36.\" http://bugs.debian.org/507673
37.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
38.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39.ie \n(.g .ds Aq \(aq
40.el .ds Aq '
41.\" -----------------------------------------------------------------
42.\" * set default formatting
43.\" -----------------------------------------------------------------
44.\" disable hyphenation
45.nh
46.\" disable justification (adjust text to left margin only)
47.ad l
48.\" -----------------------------------------------------------------
49.\" * MAIN CONTENT STARTS HERE *
50.\" -----------------------------------------------------------------
michaelm5ac8c152012-03-06 20:34:38 +000051
rgallardb6435452013-11-25 20:19:02 -080052.SH NAME
53jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&.
54.SH SYNOPSIS
55.sp
56.nf
michaelm5ac8c152012-03-06 20:34:38 +000057
rgallardb6435452013-11-25 20:19:02 -080058\fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR
59.fi
60.sp
61.TP
62\fIoptions\fR
63The command-line options\&. See Options\&.
64.TP
65\fIheap-dump-file\fR
66Java 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\&.
67.SH DESCRIPTION
68The \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/
69.PP
70There are several ways to generate a Java heap dump:
71.TP 0.2i
72\(bu
73Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
74.TP 0.2i
75\(bu
76Use 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
77.TP 0.2i
78\(bu
79Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&.
80.TP 0.2i
81\(bu
82Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
83.SH OPTIONS
84.TP
85-stack false|true
86.br
87Turns 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\&.
88.TP
89-refs false|true
90.br
91Turns 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\&.
92.TP
93-port \fIport-number\fR
94.br
95Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
96.TP
97-exclude \fIexclude-file\fR
98.br
99Specifies 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\&.
100.TP
101-baseline \fIexclude-file\fR
102.br
103Specifies 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\&.
104.TP
105-debug \fIint\fR
106.br
107Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&.
108.TP
109-version
110.br
111Reports the release number and exits
112.TP
113-h
114.br
115Dsiplays a help message and exits\&.
116.TP
117-help
118.br
119Displays a help message and exits\&.
120.TP
121-J\fIflag\fR
122.br
123Passes \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\&.
124.SH SEE\ ALSO
125.TP 0.2i
126\(bu
michaelm5ac8c152012-03-06 20:34:38 +0000127jmap(1)
rgallardb6435452013-11-25 20:19:02 -0800128.TP 0.2i
129\(bu
michaelm5ac8c152012-03-06 20:34:38 +0000130jconsole(1)
rgallardb6435452013-11-25 20:19:02 -0800131.TP 0.2i
132\(bu
133HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
134.RE
135.br
136'pl 8.5i
137'bp