Richard Uhler | b730b78 | 2015-07-15 16:01:58 -0700 | [diff] [blame] | 1 | AHAT - Android Heap Analysis Tool |
| 2 | |
| 3 | Usage: |
| 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 | |
| 11 | TODO: |
| 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. |
| 34 | * For string summaries, if the string is an offset into a bigger byte array, |
| 35 | make sure to show just the part that's in the bigger byte array, not the |
| 36 | entire byte array. |
| 37 | * For HeapTable with single heap shown, the heap name isn't centered? |
| 38 | * Consistently document functions. |
| 39 | * Should help be part of an AhatHandler, that automatically gets the menu and |
| 40 | stylesheet link rather than duplicating that? |
| 41 | * Show version number with --version. |
| 42 | * Show somewhere where to send bugs. |
| 43 | * /objects query takes a long time to load without parameters. |
| 44 | * Include a link to /objects in the overview and menu? |
| 45 | * Turn on LOCAL_JAVACFLAGS := -Xlint:unchecked -Werror |
| 46 | * Use hex for object ids in URLs? |
| 47 | * In general, all tables and descriptions should show a limited amount to |
| 48 | start, and only show more when requested by the user. |
| 49 | * Don't have handlers inherit from HttpHandler |
| 50 | - because they should be independent from http. |
| 51 | |
| 52 | * [low priority] by site allocations won't line up if the stack has been |
| 53 | truncated. Is there any way to manually line them up in that case? |
| 54 | |
| 55 | * [low priority] Have a switch to choose whether unreachable objects are |
| 56 | ignored or not? Is there any interest in what's unreachable, or is it only |
| 57 | reachable objects that people care about? |
| 58 | |
| 59 | * [low priority] Have a way to diff two heap dumps by site. |
| 60 | This should be pretty easy to do, actually. The interface is the real |
| 61 | question. Maybe: augment each byte count field on every page with the diff |
| 62 | if a baseline has been provided, and allow the user to sort by the diff. |
| 63 | |
| 64 | Things to Test: |
| 65 | * That we can open a hprof without an 'app' heap and show a tabulation of |
| 66 | objects normally sorted by 'app' heap by default. |
| 67 | * Visit /objects without parameters and verify it doesn't throw an exception. |
| 68 | * Visit /objects with an invalid site, verify it doesn't throw an exception. |
| 69 | * That we can view an array with 3 million elements in a reasonably short |
| 70 | amount of time (not more than 1 second?) |
| 71 | * That we can view the list of all objects in a reasonably short amount of |
| 72 | time. |
| 73 | * That we don't show the 'extra' column in the DominatedList if we are |
| 74 | showing all the instances. |
| 75 | |
| 76 | Reported Issues: |
| 77 | * Request to be able to sort tables by size. |
| 78 | * Hangs on showing large arrays, where hat does not hang. |
| 79 | - Solution is probably to not show all the array elements by default. |
| 80 | |
| 81 | Perflib Requests: |
| 82 | * Class objects should have java.lang.Class as their class object, not null. |
| 83 | * ArrayInstance should have asString() to get the string, without requiring a |
| 84 | length function. |
| 85 | * Document that getHeapIndex returns -1 for no such heap. |
| 86 | * Look up totalRetainedSize for a heap by Heap object, not by a separate heap |
| 87 | index. |
| 88 | * What's the difference between getId and getUniqueId? |
| 89 | * I see objects with duplicate references. |
| 90 | * Don't store stack trace by heap (CL 157252) |
| 91 | * A way to get overall retained size by heap. |
| 92 | * A method Instance.isReachable() |
| 93 | |
| 94 | Things to move to perflib: |
| 95 | * Extracting the string from a String Instance. |
| 96 | * Extracting bitmap data from bitmap instances. |
| 97 | * Adding up allocations by stack frame. |
| 98 | * Computing, for each instance, the other instances it dominates. |
| 99 | |
| 100 | Release History: |
| 101 | 0.1ss Aug 04, 2015 |
| 102 | Enable stack allocations code (using custom modified perflib). |
| 103 | Sort objects in 'objects/' with default sort. |
| 104 | |
| 105 | 0.1-stacks Aug 03, 2015 |
| 106 | Enable stack allocations code (using custom modified perflib). |
| 107 | |
| 108 | 0.1 July 30, 2015 |
| 109 | Initial Release |
| 110 | |