Demo: finding a leak with two heap dumps
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
- Start Shop with GC logging and the planted cache; run steady load.
- Confirm in the log that the post-GC floor keeps rising.
- Take dump A (
jcmd <pid> GC.heap_dump a.hprof), run load a few more minutes, take dump B. - Open both in Eclipse MAT or VisualVM; compare histograms and find the class with growing instance count.
- Planned mistake: raise
-Xmxfirst 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. - Bound the cache (size limit/eviction), rerun, and show a flat floor.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.