Index: src/core/SkResourceCache.cpp |
diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp |
index a1234e1fef455ea37997b1b96aade5acd75718d4..240d1977e53968d417de449d84ff42c8e34f405e 100644 |
--- a/src/core/SkResourceCache.cpp |
+++ b/src/core/SkResourceCache.cpp |
@@ -679,6 +679,10 @@ static void sk_trace_dump_visitor(const SkResourceCache::Rec& rec, void* context |
SkDiscardableMemory* discardable = rec.diagnostic_only_getDiscardable(); |
if (discardable) { |
dump->setDiscardableMemoryBacking(dumpName.c_str(), *discardable); |
+ |
+ // The discardable memory size will be calculated by dumper, but we also dump what we think |
+ // the size of object in memory is irrespective of whether object is live or dead. |
+ dump->dumpNumericValue(dumpName.c_str(), "discardable_size", "bytes", rec.bytesUsed()); |
} else { |
dump->dumpNumericValue(dumpName.c_str(), "size", "bytes", rec.bytesUsed()); |
dump->setMemoryBacking(dumpName.c_str(), "malloc", nullptr); |