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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4580 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mikhail.naganov@gmail.com 2010-05-04 14:30:22 +00:00
parent 4fdf57ace0
commit 3e54b5cbb0

View File

@ -3646,6 +3646,8 @@ void V8::ResumeProfilerEx(int flags, int tag) {
// those modules which haven't been started prior to making a // those modules which haven't been started prior to making a
// snapshot. // snapshot.
// Make a GC prior to taking a snapshot.
i::Heap::CollectAllGarbage(false);
// Reset snapshot flag and CPU module flags. // Reset snapshot flag and CPU module flags.
flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU); flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU);
const int current_flags = i::Logger::GetActiveProfilerModules(); const int current_flags = i::Logger::GetActiveProfilerModules();