Analyze
These modes answer what is in memory and what is big . They work on a single dump. To find out what keeps
something alive, go to Trace holders . To see what changed over time, go to Compare .
Start here
Summary is the default mode. Run it first on any dump to see the shape of the heap.
Leak suspects ranks the objects that keep the most alive, so you need no prior idea where to look.
Content previews turn "a 5 MiB char[]" into "a JSON document".
Your goal, and the page
Your goal
Command
Page
See what takes the space, by class
heaptrail -i heap.hprof
Summary
Rank classes by what they keep alive
--retained-size
Retained size
Find what is wrong without knowing where to look
--leak-suspects --exclude-soft-weak
Leak suspects
See the content of large arrays
--preview-bytes 200
Content previews
List every string, or every large text array
-l
List strings and arrays
Find the biggest bitmaps
--bitmaps
Bitmaps
Find the code that allocated something
--allocation-sites
Allocation sites
Recipes