1AHAT - Android Heap Analysis Tool
2
3Usage:
4  java -jar ahat.jar [OPTIONS] FILE
5    Launch an http server for viewing the given Android heap dump FILE.
6
7  OPTIONS:
8    -p <port>
9       Serve pages on the given port. Defaults to 7100.
10    --proguard-map FILE
11       Use the proguard map FILE to deobfuscate the heap dump.
12    --baseline FILE
13       Diff the heap dump against the given baseline heap dump FILE.
14    --baseline-proguard-map FILE
15       Use the proguard map FILE to deobfuscate the baseline heap dump.
16    --retained [strong | soft | finalizer | weak | phantom | unreachable]
17       The weakest reachability of instances to treat as retained.
18       Defaults to soft
19
20TODO:
21 * Add a user guide.
22 * Dim 'image' and 'zygote' heap sizes slightly? Why do we even show these?
23 * Let user re-sort sites objects info by clicking column headers.
24 * Let user re-sort "Objects" list.
25 * Show site context and heap and class filter in "Objects" view?
26 * Have a menu at the top of an object view with links to the sections?
27 * Include ahat version and hprof file in the menu at the top of the page?
28 * Heaped Table
29   - Make sortable by clicking on headers.
30 * For HeapTable with single heap shown, the heap name isn't centered?
31 * Consistently document functions.
32 * Show version number with --version.
33 * Show somewhere where to send bugs.
34 * Include a link to /objects in the overview and menu?
35 * Turn on LOCAL_JAVACFLAGS := -Xlint:unchecked -Werror
36
37 * [low priority] by site allocations won't line up if the stack has been
38   truncated. Is there any way to manually line them up in that case?
39
40Things to Test:
41 * That we can open a hprof without an 'app' heap and show a tabulation of
42   objects normally sorted by 'app' heap by default.
43 * Visit /objects without parameters and verify it doesn't throw an exception.
44 * Visit /objects with an invalid site, verify it doesn't throw an exception.
45 * That we can view the list of all objects in a reasonably short amount of
46   time.
47 * That we don't show the 'extra' column in the DominatedList if we are
48   showing all the instances.
49 * Instance.getDexCacheLocation
50
51Reported Issues:
52 * Request to be able to sort tables by size.
53
54Release History:
55 1.7.1 September 30, 2020
56   Fix issue parsing proguard maps with comments.
57
58 1.7 August 8, 2019
59   Annotate binder services, tokens, and proxies.
60   Add option for viewing subclass instances of a class.
61   Recognize java.lang.ref.Finalizer as a finalizer reference.
62   Minor bug fixes and API improvements.
63
64 1.6 July 24, 2018
65   Distinguish between soft/weak/phantom/etc references.
66   Annotate $classOverhead byte[] arrays with their class.
67   Show progress of heap dump processing.
68   Add --retained command line option to ahat.
69   Support heap dumps generated with HotSpotDiagnosticMXBean.
70   Updated public APIs for dominators computation, reachability and parser.
71   AhatInstance no longer implements DominatorsComputation.Node
72   Bug fixes.
73
74 1.5 December 05, 2017
75   Distinguish between weakly reachable and unreachable instances.
76   Allow hex ids to be used for objects in query parameters.
77   Restore old presentation of sample paths from gc roots.
78   Fix bug in selection of sample paths from gc root.
79   Fix bug in proguard deobfuscation of stack frames.
80   Tighten up and document ahat public API.
81
82 1.4 October 03, 2017
83   Give better error messages on failure to launch ahat.
84   Properly mark thread and non-default root objects as roots.
85   Improve startup performance, in some cases significantly.
86   Other miscellaneous bug fixes.
87
88 1.3.1 August 22, 2017
89   Don't include weak references in sample paths.
90
91 1.3 July 25, 2017
92   Improve diffing of static and instance fields.
93   Improve startup performance by roughly 25%.
94
95 1.2 May 26, 2017
96   Show registered native sizes of objects.
97   Simplify presentation of sample path from gc root.
98
99 1.1 Feb 21, 2017
100   Show java.lang.ref.Reference referents as "unreachable" instead of null.
101
102 1.0 Dec 20, 2016
103   Add support for diffing two heap dumps.
104   Remove native allocations view.
105   Remove outdated help page.
106   Significant refactoring of ahat internals.
107
108 0.8 Oct 18, 2016
109   Show sample path from GC root with field names in place of dominator path.
110
111 0.7 Aug 16, 2016
112   Launch ahat server before processing the heap dump.
113   Target Java 1.7.
114
115 0.6 Jun 21, 2016
116   Add support for proguard deobfuscation.
117
118 0.5 Apr 19, 2016
119   Update perflib to perflib-25.0.0 to improve processing performance.
120
121 0.4 Feb 23, 2016
122   Annotate char[] objects with their string values.
123   Show registered native allocations for heap dumps that support it.
124
125 0.3 Dec 15, 2015
126   Fix page loading performance by showing a limited number of entries by default.
127   Fix mismatch between overview and "roots" totals.
128   Annotate root objects and show their types.
129   Annotate references with their referents.
130
131 0.2 Oct 20, 2015
132   Take into account 'count' and 'offset' when displaying strings.
133
134 0.1ss Aug 04, 2015
135   Enable stack allocations code (using custom modified perflib).
136   Sort objects in 'objects/' with default sort.
137
138 0.1-stacks Aug 03, 2015
139   Enable stack allocations code (using custom modified perflib).
140
141 0.1 July 30, 2015
142   Initial Release
143
144