blob: 7e0c7db97ca2d724ef857db9d8fed82db3cb35e1 [file] [log] [blame]
alanb0d058232012-11-02 15:50:11 +00001." Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
michaelm5ac8c152012-03-06 20:34:38 +00002." 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19." or visit www.oracle.com if you need additional information or have any
20." questions.
21."
22.TH jhat 1 "10 May 2011"
23
24.LP
25.SH "Name"
26jhat \- Java Heap Analysis Tool
27.LP
28.SH "SYNOPSIS"
29.LP
30.nf
31\f3
32.fl
33\fP\f3jhat\fP [ \f2options\fP ] <heap\-dump\-file>
34.fl
35
36.fl
37.fi
38
39.LP
40.SH "PARAMETERS"
41.LP
42.RS 3
43.TP 3
44options
45Options, if used, should follow immediately after the command name.
46.TP 3
47heap\-dump\-file
48Java 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".
49.RE
50
51.LP
52.SH "DESCRIPTION"
53.LP
54.LP
55The \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/
56.LP
57.LP
58There are several ways to generate a java heap dump:
59.LP
60.RS 3
61.TP 2
62o
63Use jmap(1) \-dump option to obtain a heap dump at runtime;
64.TP 2
65o
66Use jconsole(1) option to obtain a heap dump via
67.na
68\f2HotSpotDiagnosticMXBean\fP @
69.fi
70http://download.oracle.com/javase/7/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean.html at runtime;
71.TP 2
72o
73Heap dump will be generated when OutOfMemoryError is thrown by specifying \-XX:+HeapDumpOnOutOfMemoryError VM option;
74.TP 2
75o
76Use
77.na
78\f2hprof\fP @
79.fi
80http://java.sun.com/developer/technicalArticles/Programming/HPROF.html.
81.RE
82
83.LP
84.LP
85\f3NOTE:\fP This tool is \f3experimental\fP and may \f3not\fP be available in future versions of the JDK.
86.LP
87.SH "OPTIONS"
88.LP
89.RS 3
90.TP 3
91\-stack false/true
92Turn 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.
93.TP 3
94\-refs false/true
95Turn 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.
96.TP 3
97\-port port\-number
98Set the port for the jhat's HTTP server. Default is 7000.
99.TP 3
100\-exclude exclude\-file
101Specify 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.
102.TP 3
103\-baseline baseline\-dump\-file
104Specify 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.
105.TP 3
106\-debug int
107Set debug level for this tool. 0 means no debug output. Set higher values for more verbose modes.
108.TP 3
109\-version
110Report version number and exit.
111.TP 3
112\-h
113Output help message and exit.
114.TP 3
115\-help
116Output help message and exit.
117.TP 3
118\-J<flag>
119Pass <flag> to the Java virtual machine on which jhat is run. For example, \-J\-Xmx512m to use a maximum heap size of 512MB.
120.RE
121
122.LP
123.SH "SEE ALSO"
124.LP
125.RS 3
126.TP 2
127o
128jmap(1)
129.TP 2
130o
131jconsole(1)
132.TP 2
133o
134.na
135\f2hprof \- Heap and CPU profiling tool\fP @
136.fi
137http://java.sun.com/developer/technicalArticles/Programming/HPROF.html
138.RE
139
140.LP
141