Index: src/heap-profiler.cc |
diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc |
index dfda7c6fec5a8e3b546b1d1e487b3993b104a23f..732d2f4102dd47d4728dbbc72dc568d4e429aa59 100644 |
--- a/src/heap-profiler.cc |
+++ b/src/heap-profiler.cc |
@@ -373,6 +373,7 @@ HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name, |
bool generation_completed = true; |
switch (s_type) { |
case HeapSnapshot::kFull: { |
+ Heap::CollectAllGarbage(true); |
HeapSnapshotGenerator generator(result, control); |
generation_completed = generator.GenerateSnapshot(); |
break; |
@@ -808,7 +809,7 @@ void AggregatedHeapSnapshotGenerator::CollectStats(HeapObject* obj) { |
void AggregatedHeapSnapshotGenerator::GenerateSnapshot() { |
- HeapIterator iterator(HeapIterator::kFilterFreeListNodes); |
+ HeapIterator iterator(HeapIterator::kFilterUnreachable); |
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
CollectStats(obj); |
agg_snapshot_->js_cons_profile()->CollectStats(obj); |