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

Unified Diff: runtime/vm/service.cc

Issue 1811713002: Perform a full GC by default when requesting a heap snapshot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 794b2facdbe75a2fc6a58ee8068411c490b6a80e..d346361653ed37a201a858b059617c7591e9aa90 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -3269,13 +3269,16 @@ static bool GetHeapMap(Thread* thread, JSONStream* js) {
static const MethodParameter* request_heap_snapshot_params[] = {
RUNNABLE_ISOLATE_PARAMETER,
+ new BoolParameter("collectGarbage", false /* not required */),
NULL,
};
static bool RequestHeapSnapshot(Thread* thread, JSONStream* js) {
+ const bool collect_garbage =
+ BoolParameter::Parse(js->LookupParam("collectGarbage"), true);
Cutch 2016/03/17 15:37:32 should the default be true?
rmacnak 2016/03/17 18:09:08 I think so.
if (Service::graph_stream.enabled()) {
- Service::SendGraphEvent(thread);
+ Service::SendGraphEvent(thread, collect_garbage);
}
// TODO(koda): Provide some id that ties this request to async response(s).
JSONObject jsobj(js);
@@ -3284,11 +3287,11 @@ static bool RequestHeapSnapshot(Thread* thread, JSONStream* js) {
}
-void Service::SendGraphEvent(Thread* thread) {
+void Service::SendGraphEvent(Thread* thread, bool collect_garbage) {
uint8_t* buffer = NULL;
WriteStream stream(&buffer, &allocator, 1 * MB);
ObjectGraph graph(thread);
- intptr_t node_count = graph.Serialize(&stream);
+ intptr_t node_count = graph.Serialize(&stream, collect_garbage);
// Chrome crashes receiving a single tens-of-megabytes blob, so send the
// snapshot in megabyte-sized chunks instead.
« runtime/observatory/lib/src/elements/heap_snapshot.dart ('K') | « runtime/vm/service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698