Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(953)

Unified Diff: runtime/vm/service.cc

Issue 2667743004: Surfaced native heap memory allocation information to the Observatory (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 1a46007c99881f263a8b8f8f9104176ca8643c9a..20f1b34b60797eef9b2511dfdc80d961cd27f1ba 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -16,6 +16,7 @@
#include "vm/debugger.h"
#include "vm/isolate.h"
#include "vm/lockers.h"
+#include "vm/malloc_hooks.h"
#include "vm/message.h"
#include "vm/message_handler.h"
#include "vm/native_entry.h"
@@ -3801,6 +3802,9 @@ void Service::PrintJSONForVM(JSONStream* js, bool ref) {
jsobj.AddProperty64("_maxRSS", OS::MaxRSS());
jsobj.AddPropertyTimeMillis(
"startTime", OS::GetCurrentTimeMillis() - Dart::UptimeMillis());
+ jsobj.AddProperty("_heapAllocatedMemoryUsage",
Cutch 2017/01/31 23:21:05 if there is a way to detect if the malloc hooks ar
bkonyi 2017/01/31 23:37:05 I've gone ahead and added MallocHooks::Initialized
+ MallocHooks::heap_allocated_memory_in_bytes());
+ jsobj.AddProperty("_heapAllocationCount", MallocHooks::allocation_count());
// Construct the isolate list.
{
JSONArray jsarr(&jsobj, "isolates");
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698