blob: 8dfb4abe5b8772d5286d4c0810bff65f91ef0321 [file] [log] [blame]
Richard Uhlerb730b782015-07-15 16:01:58 -07001AHAT - Android Heap Analysis Tool
2
3Usage:
Richard Uhlerec78c782016-05-13 14:19:37 -07004 java -jar ahat.jar [-p port] [--proguard-map FILE] FILE
Richard Uhlerb730b782015-07-15 16:01:58 -07005 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.
Richard Uhlerec78c782016-05-13 14:19:37 -070010 --proguard-map FILE
11 Use the proguard map FILE to deobfuscate the heap dump.
Richard Uhlerb730b782015-07-15 16:01:58 -070012
13TODO:
Richard Uhler8f533642016-08-15 11:01:01 -070014 * Have a way to diff two heap dumps.
15
Richard Uhlerb730b782015-07-15 16:01:58 -070016 * Add more tips to the help page.
Richard Uhlerb730b782015-07-15 16:01:58 -070017 - Recommend how to start looking at a heap dump.
18 - Say how to enable allocation sites.
19 - Where to submit feedback, questions, and bug reports.
Richard Uhlerb730b782015-07-15 16:01:58 -070020 * Dim 'image' and 'zygote' heap sizes slightly? Why do we even show these?
Richard Uhlerb730b782015-07-15 16:01:58 -070021 * Let user re-sort sites objects info by clicking column headers.
22 * Let user re-sort "Objects" list.
23 * Show site context and heap and class filter in "Objects" view?
24 * Have a menu at the top of an object view with links to the sections?
25 * Include ahat version and hprof file in the menu at the top of the page?
26 * Heaped Table
27 - Make sortable by clicking on headers.
Richard Uhlerb730b782015-07-15 16:01:58 -070028 * For HeapTable with single heap shown, the heap name isn't centered?
29 * Consistently document functions.
Richard Uhlerb730b782015-07-15 16:01:58 -070030 * Show version number with --version.
31 * Show somewhere where to send bugs.
Richard Uhlerb730b782015-07-15 16:01:58 -070032 * Include a link to /objects in the overview and menu?
33 * Turn on LOCAL_JAVACFLAGS := -Xlint:unchecked -Werror
34 * Use hex for object ids in URLs?
Richard Uhlerb730b782015-07-15 16:01:58 -070035
36 * [low priority] by site allocations won't line up if the stack has been
37 truncated. Is there any way to manually line them up in that case?
38
39 * [low priority] Have a switch to choose whether unreachable objects are
40 ignored or not? Is there any interest in what's unreachable, or is it only
41 reachable objects that people care about?
42
Richard Uhlerb730b782015-07-15 16:01:58 -070043Things to Test:
44 * That we can open a hprof without an 'app' heap and show a tabulation of
45 objects normally sorted by 'app' heap by default.
46 * Visit /objects without parameters and verify it doesn't throw an exception.
47 * Visit /objects with an invalid site, verify it doesn't throw an exception.
Richard Uhlerb730b782015-07-15 16:01:58 -070048 * That we can view the list of all objects in a reasonably short amount of
49 time.
50 * That we don't show the 'extra' column in the DominatedList if we are
51 showing all the instances.
Richard Uhler788b21e2015-08-31 10:33:56 -070052 * That InstanceUtils.asString properly takes into account "offset" and
53 "count" fields, if they are present.
Richard Uhler77ff54b2015-08-31 10:22:56 -070054 * InstanceUtils.getDexCacheLocation
Richard Uhlerb730b782015-07-15 16:01:58 -070055
56Reported Issues:
57 * Request to be able to sort tables by size.
Richard Uhlerb730b782015-07-15 16:01:58 -070058
59Perflib Requests:
60 * Class objects should have java.lang.Class as their class object, not null.
61 * ArrayInstance should have asString() to get the string, without requiring a
62 length function.
63 * Document that getHeapIndex returns -1 for no such heap.
64 * Look up totalRetainedSize for a heap by Heap object, not by a separate heap
65 index.
66 * What's the difference between getId and getUniqueId?
67 * I see objects with duplicate references.
Richard Uhlerb730b782015-07-15 16:01:58 -070068 * A way to get overall retained size by heap.
69 * A method Instance.isReachable()
70
71Things to move to perflib:
72 * Extracting the string from a String Instance.
73 * Extracting bitmap data from bitmap instances.
74 * Adding up allocations by stack frame.
75 * Computing, for each instance, the other instances it dominates.
Richard Uhler38f9eba2015-11-11 08:31:52 -080076 * Instance.isRoot and Instance.getRootTypes.
Richard Uhlerb730b782015-07-15 16:01:58 -070077
78Release History:
Richard Uhlere087f1f2016-10-18 16:26:50 +010079 0.9 Pending
80
81 0.8 Oct 18, 2016
Richard Uhler69286492016-09-20 10:41:47 +010082 Show sample path from GC root with field names in place of dominator path.
Richard Uhler8f533642016-08-15 11:01:01 -070083
84 0.7 Aug 16, 2016
85 Launch ahat server before processing the heap dump.
86 Target Java 1.7.
87
88 0.6 Jun 21, 2016
Richard Uhlerec78c782016-05-13 14:19:37 -070089 Add support for proguard deobfuscation.
Richard Uhler6919a012015-12-15 09:15:00 -080090
91 0.5 Apr 19, 2016
92 Update perflib to perflib-25.0.0 to improve processing performance.
93
94 0.4 Feb 23, 2016
Richard Uhlerc7f77122016-02-11 08:48:24 -080095 Annotate char[] objects with their string values.
Richard Uhler1a5baaa2015-12-21 12:47:26 -080096 Show registered native allocations for heap dumps that support it.
97
Richard Uhlera7f46cb2015-12-21 14:34:59 -080098 0.3 Dec 15, 2015
99 Fix page loading performance by showing a limited number of entries by default.
100 Fix mismatch between overview and "roots" totals.
101 Annotate root objects and show their types.
102 Annotate references with their referents.
103
Richard Uhlerc237b392015-10-20 10:03:38 -0700104 0.2 Oct 20, 2015
105 Take into account 'count' and 'offset' when displaying strings.
106
Richard Uhlerb730b782015-07-15 16:01:58 -0700107 0.1ss Aug 04, 2015
108 Enable stack allocations code (using custom modified perflib).
109 Sort objects in 'objects/' with default sort.
110
111 0.1-stacks Aug 03, 2015
112 Enable stack allocations code (using custom modified perflib).
113
114 0.1 July 30, 2015
115 Initial Release
116