Skip to content
Ameen Abozaid
Planned lessonMID-002-L07

Demo: finding a leak with two heap dumps

  • Lesson 7 of 7
  • Mid-level
On This Lesson 3 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

locate a leak by diffing dumps; prepares MID-002-LAB1.

Draft outline details

Step by step

  1. Start Shop with GC logging and the planted cache; run steady load.
  2. Confirm in the log that the post-GC floor keeps rising.
  3. Take dump A (jcmd <pid> GC.heap_dump a.hprof), run load a few more minutes, take dump B.
  4. Open both in Eclipse MAT or VisualVM; compare histograms and find the class with growing instance count.
  5. Planned mistake: raise -Xmx first and declare it fixed because the crash is later. Fix: follow the path to GC roots (dominator tree, "path to GC roots") to the static map.
  6. Bound the cache (size limit/eviction), rerun, and show a flat floor.

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.

Type to search levels, phases, modules and lessons.