blob: 1083c2f42fc8e3215aa8cd2241f44dddef33a29b [file] [log] [blame]
Richard Uhlerb730b782015-07-15 16:01:58 -07001AHAT - Android Heap Analysis Tool
2
3Usage:
4 java -jar ahat.jar [-p port] 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
11TODO:
12 * Add more tips to the help page.
13 - Note that only 'app' heap matters, not 'zygote' or 'image'.
14 - Say what a dex cache is.
15 - Recommend how to start looking at a heap dump.
16 - Say how to enable allocation sites.
17 - Where to submit feedback, questions, and bug reports.
18 * Submit perflib fix for getting stack traces, then uncomment that code in
19 AhatSnapshot to use that.
20 * Dim 'image' and 'zygote' heap sizes slightly? Why do we even show these?
21 * Filter out RootObjs in mSnapshot.getGCRoots, not RootsHandler.
22 * Let user re-sort sites objects info by clicking column headers.
23 * Let user re-sort "Objects" list.
24 * Show site context and heap and class filter in "Objects" view?
25 * Have a menu at the top of an object view with links to the sections?
26 * Include ahat version and hprof file in the menu at the top of the page?
27 * Heaped Table
28 - Make sortable by clicking on headers.
29 - Use consistent order for heap columns.
30 Sometimes I see "app" first, sometimes last (from one heap dump to
31 another) How about, always sort by name?
32 * For long strings, limit the string length shown in the summary view to
33 something reasonable. Say 50 chars, then add a "..." at the end.
Richard Uhlerb730b782015-07-15 16:01:58 -070034 * For HeapTable with single heap shown, the heap name isn't centered?
35 * Consistently document functions.
36 * Should help be part of an AhatHandler, that automatically gets the menu and
37 stylesheet link rather than duplicating that?
38 * Show version number with --version.
39 * Show somewhere where to send bugs.
40 * /objects query takes a long time to load without parameters.
41 * Include a link to /objects in the overview and menu?
42 * Turn on LOCAL_JAVACFLAGS := -Xlint:unchecked -Werror
43 * Use hex for object ids in URLs?
44 * In general, all tables and descriptions should show a limited amount to
45 start, and only show more when requested by the user.
46 * Don't have handlers inherit from HttpHandler
47 - because they should be independent from http.
48
49 * [low priority] by site allocations won't line up if the stack has been
50 truncated. Is there any way to manually line them up in that case?
51
52 * [low priority] Have a switch to choose whether unreachable objects are
53 ignored or not? Is there any interest in what's unreachable, or is it only
54 reachable objects that people care about?
55
56 * [low priority] Have a way to diff two heap dumps by site.
57 This should be pretty easy to do, actually. The interface is the real
58 question. Maybe: augment each byte count field on every page with the diff
59 if a baseline has been provided, and allow the user to sort by the diff.
60
61Things to Test:
62 * That we can open a hprof without an 'app' heap and show a tabulation of
63 objects normally sorted by 'app' heap by default.
64 * Visit /objects without parameters and verify it doesn't throw an exception.
65 * Visit /objects with an invalid site, verify it doesn't throw an exception.
66 * That we can view an array with 3 million elements in a reasonably short
67 amount of time (not more than 1 second?)
68 * That we can view the list of all objects in a reasonably short amount of
69 time.
70 * That we don't show the 'extra' column in the DominatedList if we are
71 showing all the instances.
Richard Uhler788b21e2015-08-31 10:33:56 -070072 * That InstanceUtils.asString properly takes into account "offset" and
73 "count" fields, if they are present.
Richard Uhlerb730b782015-07-15 16:01:58 -070074
75Reported Issues:
76 * Request to be able to sort tables by size.
77 * Hangs on showing large arrays, where hat does not hang.
78 - Solution is probably to not show all the array elements by default.
79
80Perflib Requests:
81 * Class objects should have java.lang.Class as their class object, not null.
82 * ArrayInstance should have asString() to get the string, without requiring a
83 length function.
84 * Document that getHeapIndex returns -1 for no such heap.
85 * Look up totalRetainedSize for a heap by Heap object, not by a separate heap
86 index.
87 * What's the difference between getId and getUniqueId?
88 * I see objects with duplicate references.
89 * Don't store stack trace by heap (CL 157252)
90 * A way to get overall retained size by heap.
91 * A method Instance.isReachable()
92
93Things to move to perflib:
94 * Extracting the string from a String Instance.
95 * Extracting bitmap data from bitmap instances.
96 * Adding up allocations by stack frame.
97 * Computing, for each instance, the other instances it dominates.
98
99Release History:
100 0.1ss Aug 04, 2015
101 Enable stack allocations code (using custom modified perflib).
102 Sort objects in 'objects/' with default sort.
103
104 0.1-stacks Aug 03, 2015
105 Enable stack allocations code (using custom modified perflib).
106
107 0.1 July 30, 2015
108 Initial Release
109