1jhat(1) Troubleshooting Tools jhat(1)
2
3
4
6 jhat - Analyzes the Java heap. This command is experimental and
7 unsupported.
8
10 jhat [ options ] heap-dump-file
11
12
13 options
14 The command-line options. See Options.
15
16 heap-dump-file
17 Java binary heap dump file to be browsed. For a dump file that
18 contains multiple heap dumps, you can specify which dump in the
19 file by appending #<number> to the file name, for example,
20 myfile.hprof#3.
21
23 The jhat command parses a Java heap dump file and starts a web server.
24 The jhat command lets you to browse heap dumps with your favorite web
25 browser. The jhat command supports predesigned queries such as show all
26 instances of a known class MyClass, and Object Query Language (OQL).
27 OQL is similar to SQL, except for querying heap dumps. Help on OQL is
28 available from the OQL help page shown by the jhat command. With the
29 default port, OQL help is available at http://localhost:7000/oqlhelp/
30
31 There are several ways to generate a Java heap dump:
32
33 · Use the jmap -dump option to obtain a heap dump at runtime. See
34 jmap(1).
35
36 · Use the jconsole option to obtain a heap dump through
37 HotSpotDiagnosticMXBean at runtime. See jconsole(1) and the
38 HotSpotDiagnosticMXBean interface description at
39 http://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean.html
40
41 · Heap dump is generated when an OutOfMemoryError is thrown by
42 specifying the -XX:+HeapDumpOnOutOfMemoryError Java Virtual Machine
43 (JVM) option.
44
45 · Use the hprof command. See the HPROF: A Heap/CPU Profiling Tool at
46 http://docs.oracle.com/javase/8/docs/technotes/samples/hprof.html
47
49 -stack false|true
50 Turns off tracking object allocation call stack. If allocation
51 site information is not available in the heap dump, then you
52 have to set this flag to false. The default is true.
53
54 -refs false|true
55 Turns off tracking of references to objects. Default is true. By
56 default, back pointers, which are objects that point to a
57 specified object such as referrers or incoming references, are
58 calculated for all objects in the heap.
59
60 -port port-number
61 Sets the port for the jhat HTTP server. Default is 7000.
62
63 -exclude exclude-file
64 Specifies a file that lists data members that should be excluded
65 from the reachable objects query. For example, if the file lists
66 java.lang.String.value, then, then whenever the list of objects
67 that are reachable from a specific object o are calculated,
68 reference paths that involve java.lang.String.value field are
69 not considered.
70
71 -baseline exclude-file
72 Specifies a baseline heap dump. Objects in both heap dumps with
73 the same object ID are marked as not being new. Other objects
74 are marked as new. This is useful for comparing two different
75 heap dumps.
76
77 -debug int
78 Sets the debug level for this tool. A level of 0 means no debug
79 output. Set higher values for more verbose modes.
80
81 -version
82 Reports the release number and exits
83
84 -h
85 Dsiplays a help message and exits.
86
87 -help
88 Displays a help message and exits.
89
90 -Jflag
91 Passes flag to the Java Virtual Machine on which the jhat
92 command is running. For example, -J-Xmx512m to use a maximum
93 heap size of 512 MB.
94
96 · jmap(1)
97
98 · jconsole(1)
99
100 · HPROF: A Heap/CPU Profiling Tool at
101 http://docs.oracle.com/javase/8/docs/technotes/samples/hprof.html
102
103
104
105JDK 8 21 November 2013 jhat(1)