Revision: 4580
Author: [email protected]
Date: Tue May  4 07:30:22 2010
Log: Do a GC pass prior to collecting a heap profile.

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

Review URL: http://codereview.chromium.org/1949001
http://code.google.com/p/v8/source/detail?r=4580

Modified:
 /branches/bleeding_edge/src/api.cc

=======================================
--- /branches/bleeding_edge/src/api.cc  Wed Apr 28 04:59:43 2010
+++ /branches/bleeding_edge/src/api.cc  Tue May  4 07:30:22 2010
@@ -3646,6 +3646,8 @@
     // 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