Index: runtime/vm/heap.cc |
=================================================================== |
--- runtime/vm/heap.cc (revision 23950) |
+++ runtime/vm/heap.cc (working copy) |
@@ -7,6 +7,7 @@ |
#include "platform/assert.h" |
#include "platform/utils.h" |
#include "vm/flags.h" |
+#include "vm/heap_histogram.h" |
#include "vm/heap_profiler.h" |
#include "vm/isolate.h" |
#include "vm/object.h" |
@@ -162,6 +163,7 @@ |
old_space_->MarkSweep(invoke_api_callbacks); |
RecordAfterGC(); |
PrintStats(); |
+ UpdateObjectHistogram(); |
break; |
} |
default: |
@@ -170,6 +172,13 @@ |
} |
+void Heap::UpdateObjectHistogram() { |
+ Isolate* isolate = Isolate::Current(); |
+ if (isolate->object_histogram() == NULL) return; |
+ isolate->object_histogram()->Collect(); |
+} |
+ |
+ |
void Heap::CollectGarbage(Space space) { |
ApiCallbacks api_callbacks; |
if (space == kOld) { |
@@ -190,6 +199,7 @@ |
old_space_->MarkSweep(kInvokeApiCallbacks); |
RecordAfterGC(); |
PrintStats(); |
+ UpdateObjectHistogram(); |
} |