# Help

## Information shown by ahat:

- The total bytes retained by heap.
- A list of rooted objects and their retained sizes for each heap.
- Information about each allocated object:
  - The allocation site (stack trace) of the object (if available).
  - The dominator path from a root to the object.
  - The class, (shallow) size, retained size, and heap of the object.
  - The bitmap image for the object if the object represents a bitmap.
  - The instance fields or array elements of the object.
  - The super class, class loader, and static fields of class objects.
  - Other objects with references to the object.
  - Other objects immediately dominated by the object.
- A list of objects, optionally filtered by class, allocation site, and/or heap.
- Information about each allocation site:
  - The stack trace for the allocation site.
  - The number of bytes allocated at the allocation site.
  - Child sites called from the allocation site.
  - The size and count of objects allocated at the site, organized by heap and object type.

## Tips:

### Heaps

Android heap dumps contain information for multiple heaps. The app heap is the memory used by your application. The zygote and image heaps are used by the system. You should ignore everything in the zygote and image heap and look only at the app heap. This is because changes in your application will not effect the zygote or image heaps, and because the zygote and image heaps are shared, they don't contribute significantly to your applications PSS.

### Bitmaps

Bitmaps store their data using byte[] arrays. Whenever you see a large byte[], check if it is a bitmap by looking to see if there is a single android.graphics.Bitmap object referring to it. The byte[] will be marked as a root, but it is really being retained by the android.graphics.Bitmap object.

### DexCaches

For each DexFile you load, there will be a corresponding DexCache whose size is proportional to the number of strings, fields, methods, and classes in your dex file. The DexCache entries may or may not be visible depending on the version of the Android platform the heap dump is from.

### FinalizerReferences

A FinalizerReference is allocated for every object on the heap that has a non-trivial finalizer. These are stored in a linked list reachable from the FinalizerReference class object.