Skip to content

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

  1. Summary is the default mode. Run it first on any dump to see the shape of the heap.
  2. Leak suspects ranks the objects that keep the most alive, so you need no prior idea where to look.
  3. 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

Your problem Recipe
One giant array and no idea what it is Identify a giant array
The same large payload may be in memory many times Find duplicate payloads
A dump you did not take, from an app you do not know Triage an unfamiliar dump