Reviewers: Søren Gjesse,

Description:
Do a GC pass prior to collecting a heap profile.

It seems that doing an extra GC pass results in less cluttered heap snapshots.

Please review this at http://codereview.chromium.org/1949001/show

Affected files:
  M src/api.cc


Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 85c21fb178c9f945fb690d99c6096fece7cf4405..4709a156b4bd9f6780260a6f45143140738edf04 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3646,6 +3646,8 @@ void V8::ResumeProfilerEx(int flags, int tag) {
     // those modules which haven't been started prior to making a
     // snapshot.

+    // Make a GC prior to taking a snapshot.
+    i::Heap::CollectAllGarbage(false);
     // Reset snapshot flag and CPU module flags.
     flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU);
     const int current_flags = i::Logger::GetActiveProfilerModules();


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to