Java Tool Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 5.11

Starting 'jhat' Web Server on a Heap Dump File

This section provides a tutorial example on how to start 'jhat' as a Web server on a Java heap dump file allowing you to browse Java heap objects.

In an earlier tutorial example, I created a Java heap dump file with the "jmap" tool on my GarbageCollection.java program. The heap dump file is named as GarbageCollection.map. Now I want to try to run the "jhat" Web server on this dump file and browse the heap dump with a Web browser.

1. Run the "jhat" command with default options:

C:\herong>\Progra~1\java\jdk1.6.0_02\bin\jhat GarbageCollection.map

Reading from GarbageCollection.map...
Dump file created Jan 1 00:08:10 EDT 2008
Snapshot read, resolving...
Resolving 67324 objects...
Chasing references, expect 13 dots.............
Eliminating duplicate references.............
Snapshot resolved.
Started HTTP server on port 7000
Server is ready.

2. Run a Web browser with http://localhost:7000. The "jhat" heap dump file server page shows up:
jhat Heap Dump File Server

See next sections on how to use "jhat" Web server to browse heap objects.

Sections in This Chapter

JVM Troubleshooting Tools in JDK 1.5

'jinfo' - VM Option Value Checker

Changing HotSpot VM Option using 'jinfo'

'jstack' - Stack Tracer of JVM Threads

Java Thread Deadlock Demo Program

Detecting Java Thread Deadlocks with 'jstack'

'jmap' - JVM Heap Dump Tool

Printing Histogram of Java Object Heap

Generating Heap Dump File with 'jmap'

'jhat' - Java Heap Analysis Tool

Starting 'jhat' Web Server on a Heap Dump File

Listing Instance Counts of All Classes

Browsing Object Instance Values

Object Query Language (OQL)

Searching for Instances with OQL Statements

Dr. Herong Yang, updated in 2008
Starting 'jhat' Web Server on a Heap Dump File