1<!--
2Copyright (C) 2015 The Android Open Source Project
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15-->
16
17<h1>Help</h1>
18<h2>Information shown by ahat:</h2>
19<ul>
20  <li><a href="/">The total bytes retained by heap.</a></li>
21  <li><a href="/rooted">A list of rooted objects and their retained sizes for each heap.</a></li>
22  <li>Information about each allocated object:
23    <ul>
24      <li>The allocation site (stack trace) of the object (if available).</li>
25      <li>The dominator path from a root to the object.</li>
26      <li>The class, (shallow) size, retained size, and heap of the object.</li>
27      <li>The bitmap image for the object if the object represents a bitmap.</li>
28      <li>The instance fields or array elements of the object.</li>
29      <li>The super class, class loader, and static fields of class objects.</li>
30      <li>Other objects with references to the object.</li>
31      <li>Other objects immediately dominated by the object.</li>
32    </ul>
33  </li>
34  <li>A list of objects, optionally filtered by class, allocation site, and/or
35    heap.</li>
36  <li><a href="site">Information about each allocation site:</a>
37    <ul>
38      <li>The stack trace for the allocation site.</li>
39      <li>The number of bytes allocated at the allocation site.</li>
40      <li>Child sites called from the allocation site.</li>
41      <li>The size and count of objects allocated at the site, organized by
42        heap and object type.</li>
43    </ul>
44  </li>
45</ul>
46
47<h2>Tips:</h2>
48<h3>Heaps</h3>
49<p>
50Android heap dumps contain information for multiple heaps. The <b>app</b> heap
51is the memory used by your application. The <b>zygote</b> and <b>image</b>
52heaps are used by the system. You should ignore everything in the zygote and
53image heap and look only at the app heap. This is because changes in your
54application will not effect the zygote or image heaps, and because the zygote
55and image heaps are shared, they don't contribute significantly to your
56applications PSS.
57</p>
58
59<h3>Bitmaps</h3>
60<p>
61Bitmaps store their data using byte[] arrays. Whenever you see a large
62byte[], check if it is a bitmap by looking to see if there is a single
63android.graphics.Bitmap object referring to it. The byte[] will be marked as a
64root, but it is really being retained by the android.graphics.Bitmap object.
65</p>
66
67<h3>DexCaches</h3>
68<p>
69For each DexFile you load, there will be a corresponding DexCache whose size
70is proportional to the number of strings, fields, methods, and classes in your
71dex file. The DexCache entries may or may not be visible depending on the
72version of the Android platform the heap dump is from.
73</p>
74
75<h3>FinalizerReferences</h3>
76<p>
77A FinalizerReference is allocated for every object on the heap that has a
78non-trivial finalizer. These are stored in a linked list reachable from the
79FinalizerReference class object.
80</p>
81