Index: runtime/vm/service.cc |
=================================================================== |
--- runtime/vm/service.cc (revision 35753) |
+++ runtime/vm/service.cc (working copy) |
@@ -19,6 +19,7 @@ |
#include "vm/native_entry.h" |
#include "vm/native_arguments.h" |
#include "vm/object.h" |
+#include "vm/object_graph.h" |
#include "vm/object_id_ring.h" |
#include "vm/object_store.h" |
#include "vm/port.h" |
@@ -888,6 +889,12 @@ |
Array::empty_array())); |
result.PrintJSON(js, true); |
return true; |
+ } else if (strcmp(action, "retained") == 0) { |
+ ObjectGraph graph(isolate); |
+ intptr_t retained_size = graph.SizeRetainedByInstance(obj); |
+ const Object& result = Object::Handle(Integer::New(retained_size)); |
+ result.PrintJSON(js, true); |
+ return true; |
} |
PrintError(js, "unrecognized action '%s'\n", action); |