summaryrefslogtreecommitdiff
path: root/tools/ahat/src/ObjectsHandler.java
diff options
context:
space:
mode:
author Richard Uhler <ruhler@google.com> 2017-07-04 15:55:19 +0100
committer Richard Uhler <ruhler@google.com> 2017-07-20 09:31:22 +0100
commit2687050dc64fa420ede2a9bd44550bd5af3e9c9a (patch)
tree88687ed5f59b1cad0d3e331edc9fad1b7bd5aec4 /tools/ahat/src/ObjectsHandler.java
parente4a19f603a0e112d93b17d7e483bf9e8c9caa27b (diff)
ahat: Switch to a custom dominators implementation.
Rather than relying on perflib's dominators computation, use our own. Benefits: * Over 25% improvement in heap dump processing performance, improving ahat startup time by around 1 to 3 seconds on typical Android heap dumps. * Provides more flexibility if we want to tweak the dominators computation in the future, for example by treating different soft/weak/finalizer differently or additional performance tuning. * Opens the door to future performance optimizations based around eliminating the impedance mismatch between perflib and ahat's internal representations of the heap dump. * Opens the door to possible future features that involve computing dominators of non-heap objects, such as dex code items. * Avoids a bug in perflib's dominators computation when there are duplicate class or instance dumps. Also included in this change: * Include "class" in toString for class objects. * Compute Site ObjectsInfos bottom-up in a separate pass. Bug: 34884751 Bug: 33957507 Test: m ahat-test, with new tests for incoming references and dominators. Test: Confirm dominator parity with perflib's dominators computation on a number of real heap dumps. Test: Visually compare information reported for overview, rooted, sites, object, and objects pages on a real heap dump against ahat-1.2. Change-Id: I4cf8fb177a0aaaee07ad6fddbc574682f91cc0f7
Diffstat (limited to 'tools/ahat/src/ObjectsHandler.java')
-rw-r--r--tools/ahat/src/ObjectsHandler.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/tools/ahat/src/ObjectsHandler.java b/tools/ahat/src/ObjectsHandler.java
index 86d48f1702..fd226c24bf 100644
--- a/tools/ahat/src/ObjectsHandler.java
+++ b/tools/ahat/src/ObjectsHandler.java
@@ -43,13 +43,7 @@ class ObjectsHandler implements AhatHandler {
Site site = mSnapshot.getSite(id, depth);
List<AhatInstance> insts = new ArrayList<AhatInstance>();
- for (AhatInstance inst : site.getObjects()) {
- if ((heapName == null || inst.getHeap().getName().equals(heapName))
- && (className == null || inst.getClassName().equals(className))) {
- insts.add(inst);
- }
- }
-
+ site.getObjects(heapName, className, insts);
Collections.sort(insts, Sort.defaultInstanceCompare(mSnapshot));
doc.title("Objects");