Show registered native allocations in ahat.
Bug: 23130675
Change-Id: I1d7f41a47a956b30611429b9bd395ec5f9580209
diff --git a/tools/ahat/src/OverviewHandler.java b/tools/ahat/src/OverviewHandler.java
index 720fcb4..0dbad7e 100644
--- a/tools/ahat/src/OverviewHandler.java
+++ b/tools/ahat/src/OverviewHandler.java
@@ -48,6 +48,22 @@
doc.section("Heap Sizes");
printHeapSizes(doc, query);
+
+ List<InstanceUtils.NativeAllocation> allocs = mSnapshot.getNativeAllocations();
+ if (!allocs.isEmpty()) {
+ doc.section("Registered Native Allocations");
+ long totalSize = 0;
+ for (InstanceUtils.NativeAllocation alloc : allocs) {
+ totalSize += alloc.size;
+ }
+ doc.descriptions();
+ doc.description(DocString.text("Number of Registered Native Allocations"),
+ DocString.format("%,14d", allocs.size()));
+ doc.description(DocString.text("Total Size of Registered Native Allocations"),
+ DocString.format("%,14d", totalSize));
+ doc.end();
+ }
+
doc.big(Menu.getMenu());
}