blob: 5ec79e3c5dffb0bf7a6c38c1fefec50aaa7bf5ab [file] [log] [blame]
duke6e45e102007-12-01 00:00:00 +00001." Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
2." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3."
4." This code is free software; you can redistribute it and/or modify it
5." under the terms of the GNU General Public License version 2 only, as
6." published by the Free Software Foundation.
7."
8." This code is distributed in the hope that it will be useful, but WITHOUT
9." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11." version 2 for more details (a copy is included in the LICENSE file that
12." accompanied this code).
13."
14." You should have received a copy of the GNU General Public License version
15." 2 along with this work; if not, write to the Free Software Foundation,
16." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17."
18." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
19." CA 95054 USA or visit www.sun.com if you need additional information or
20." have any questions.
21."
tbell16c34dd2009-05-04 18:28:26 -070022.TH jhat 1 "04 May 2009"
23." Generated from HTML by html2man (author: Eric Armstrong)
duke6e45e102007-12-01 00:00:00 +000024
25.LP
tbell16c34dd2009-05-04 18:28:26 -070026.SH "Name"
duke6e45e102007-12-01 00:00:00 +000027jhat \- Java Heap Analysis Tool
28.LP
29.SH "SYNOPSIS"
30.LP
31
32.LP
33.nf
34\f3
35.fl
36\fP\f3jhat\fP [ \f2options\fP ] <heap\-dump\-file>
37.fl
38
39.fl
40.fi
41
42.LP
43.SH "PARAMETERS"
44.LP
45
46.LP
tbell16c34dd2009-05-04 18:28:26 -070047.RS 3
duke6e45e102007-12-01 00:00:00 +000048.TP 3
49options
50Options, if used, should follow immediately after the command name.
tbell16c34dd2009-05-04 18:28:26 -070051.br
duke6e45e102007-12-01 00:00:00 +000052.TP 3
53heap\-dump\-file
54Java binary heap dump file to be browsed. For a dump file that contains multiple heap dumps, you may specify which dump in the file by appending "#<number> to the file name, i.e. "foo.hprof#3".
tbell16c34dd2009-05-04 18:28:26 -070055.SH "DESCRIPTION"
duke6e45e102007-12-01 00:00:00 +000056.LP
57.LP
58The \f3jhat\fP command parses a java heap dump file and launches a webserver. jhat enables you to browse heap dumps using your favorite webbrowser. jhat supports pre\-designed queries (such as 'show all instances of a known class "Foo"') as well as \f3OQL\fP (\f3O\fPbject \f3Q\fPuery \f3L\fPanguage) \- a SQL\-like query language to query heap dumps. Help on OQL is available from the OQL help page shown by jhat. With the default port, OQL help is available at http://localhost:7000/oqlhelp/
59.LP
60.LP
61There are several ways to generate a java heap dump:
62.LP
63.RS 3
64.TP 2
tbell16c34dd2009-05-04 18:28:26 -070065o
66Use jmap(1) \-dump option to obtain a heap dump at runtime;
duke6e45e102007-12-01 00:00:00 +000067.TP 2
tbell16c34dd2009-05-04 18:28:26 -070068o
69Use jconsole(1) option to obtain a heap dump via
duke6e45e102007-12-01 00:00:00 +000070.na
71\f2HotSpotDiagnosticMXBean\fP @
72.fi
tbell16c34dd2009-05-04 18:28:26 -070073http://java.sun.com/javase/6/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean.html at runtime;
duke6e45e102007-12-01 00:00:00 +000074.TP 2
tbell16c34dd2009-05-04 18:28:26 -070075o
duke6e45e102007-12-01 00:00:00 +000076Heap dump will be generated when OutOfMemoryError is thrown by specifying \-XX:+HeapDumpOnOutOfMemoryError VM option;
77.TP 2
tbell16c34dd2009-05-04 18:28:26 -070078o
duke6e45e102007-12-01 00:00:00 +000079Use
80.na
81\f2hprof\fP @
82.fi
83http://java.sun.com/developer/technicalArticles/Programming/HPROF.html.
84.RE
85
86.LP
87.LP
88\f3NOTE:\fP This tool is \f3experimental\fP and may \f3not\fP be available in future versions of the JDK.
89.LP
tbell16c34dd2009-05-04 18:28:26 -070090.SH "OPTIONS"
91.RS 3
duke6e45e102007-12-01 00:00:00 +000092.TP 3
93\-stack false/true
94Turn off tracking object allocation call stack. Note that if allocation site information is not available in the heap dump, you have to set this flag to false. Default is true.
95.TP 3
96\-refs false/true
97Turn off tracking of references to objects. Default is true. By default, back pointers (objects pointing to a given object a.k.a referrers or in\-coming references) are calculated for all objects in the heap.
98.TP 3
99\-port port\-number
100Set the port for the jhat's HTTP server. Default is 7000.
101.TP 3
102\-exclude exclude\-file
103Specify a file that lists data members that should be excluded from the "reachable objects" query. For example, if the file lists \f2java.lang.String.value\fP, then, whenever list of objects reachable from a specific object "o" are calculated, reference paths involving \f2java.lang.String.value\fP field will not considered.
104.TP 3
105\-baseline baseline\-dump\-file
106Specify a baseline heap dump. Objects in both heap dumps with the same object ID will be marked as not being "new". Other objects will be marked as "new". This is useful while comparing two different heap dumps.
107.TP 3
108\-debug int
109Set debug level for this tool. 0 means no debug output. Set higher values for more verbose modes.
110.TP 3
111\-version\
112Report version number and exit.
113.TP 3
114\-h\
115Output help message and exit.
116.TP 3
117\-help\
118Output help message and exit.
119.TP 3
120\-J<flag>\
121Pass <flag> to the Java virtual machine on which jhat is run. For example, \-J\-Xmx512m to use a maximum heap size of 512MB.
tbell16c34dd2009-05-04 18:28:26 -0700122.RE
123
duke6e45e102007-12-01 00:00:00 +0000124.LP
tbell16c34dd2009-05-04 18:28:26 -0700125.SH "SEE ALSO"
duke6e45e102007-12-01 00:00:00 +0000126.RS 3
127.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700128o
129jmap(1)
duke6e45e102007-12-01 00:00:00 +0000130.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700131o
132jconsole(1)
duke6e45e102007-12-01 00:00:00 +0000133.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700134o
duke6e45e102007-12-01 00:00:00 +0000135.na
136\f2hprof \- Heap and CPU profiling tool\fP @
137.fi
138http://java.sun.com/developer/technicalArticles/Programming/HPROF.html
139.RE
tbell16c34dd2009-05-04 18:28:26 -0700140.RE
duke6e45e102007-12-01 00:00:00 +0000141