Skip to content
Ameen Abozaid
Planned lessonMID-008-L06

Heap dumps

  • Lesson 6 of 8
  • Mid-level
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

capture and analyze a heap dump for large retainers.

Planned topics

  • Capture: jcmd <pid> GC.heap_dump file.hprof; it pauses the app and creates a large file; handle carefully (may contain secrets).
  • Open in Eclipse MAT or VisualVM.
  • Shallow size is the object itself; retained size is what would be freed if it went away.
  • Dominator tree lists biggest retainers; "path to GC roots" explains why it is live.
  • Compare two dumps to find growth.
Draft outline details

Demonstration

dominator tree: ConcurrentHashMap retaining 480 MB of Product.

Check your understanding

What is retained size?

Show answer

Memory that would be freed if that object were removed.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.