Viewing a Heap Dump File

This section provides a tutorial example on how to view a heap dump file with Java VisualVM. It allows you to see list of classes with object counts and total sizes.

Java VisualVM can also be used to view a heap dump file created previously by Java VisualVM or other Java tools.

1. Run Java VisualVM.

2. Click "File > Load..." menu. Find and load the heap dump file, heap_dump.hprof, created in the previous tutorial.

3. Click the Classes tab. A list of all classes is displayed with their objects and total memory sizes as shown below:
Java VisualVM - Heap Dump Class List

4. Find the java.lang.String class, which has 12,901 objects (instances) and uses 8.7% of the heap memory.

5. Double-click on java.lang.String to list all objects of this class. Java VisualVM switches the Instances tab with detailed info of the first object.

6. Find the "value" in the Fields panel. You see this java.lang.String object contains "file:/C:/Program%20Files/Java/jdk1.8.0/..." as shown below:
Java VisualVM - Heap Dump Object Detail View

Last update: 2015.

Table of Contents

 About This Book

 Java Tools Terminology

 Installing Java 8 on Windows

 'javac' - The Java Program Compiler

 'java' - The Java Program Launcher

 'jdb' - The Java Debugger

 'jconsole' - Java Monitoring and Management Console

 'jstat' - JVM Statistics Monitoring Tool

 JVM Troubleshooting Tools

jvisualvm (Java VisualVM) - JVM Visual Tool

 What Is jvisualvm (Java VisualVM)?

 jvisualvm Command to Open Dump Files or Conections

 Connecting Java VisualVM to a Local JVM Process

 Monitoring Usgaes of CPU, Heap, Classes and Threads

 Monitoring Thread Status as Timeline

 Taking Thread Dump to See Thread Stack Traces

 Taking Heap Dump to See Memory Usages

Viewing a Heap Dump File

 Connecting to Remote JVM Processes

 Avaible Plugins and Installation

 Installing Visual GC Plugin

 'jar' - The JAR File Tool

 'javap' - The Java Class File Disassembler

 'keytool' - Public Key Certificate Tool

 'native2ascii' - Native-to-ASCII Encoding Converter

 Outdated Tutorials


 PDF Printing Version