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