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

Unified Diff: runtime/vm/service.cc

Issue 2953373002: [observatory] Add a 'GC' button to heap map. (Closed)
Patch Set: Created 3 years, 6 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/tests/service/service_test_common.dart ('k') | tools/observatory_tool.py » ('j') | 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 4c49fcf8df692581aed6045eeb94ada6a49f4fc5..85167d122c90c2257a199324386a837f9b2ebf48 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -3477,6 +3477,18 @@ static const MethodParameter* get_heap_map_params[] = {
static bool GetHeapMap(Thread* thread, JSONStream* js) {
Isolate* isolate = thread->isolate();
+ bool should_collect = false;
+ if (js->HasParam("gc")) {
+ if (js->ParamIs("gc", "full")) {
+ should_collect = true;
+ } else {
+ PrintInvalidParamError(js, "gc");
+ return true;
+ }
+ }
+ if (should_collect) {
+ isolate->heap()->CollectAllGarbage();
+ }
isolate->heap()->PrintHeapMapToJSONStream(isolate, js);
return true;
}
« no previous file with comments | « runtime/observatory/tests/service/service_test_common.dart ('k') | tools/observatory_tool.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698