Index: runtime/vm/pages.cc |
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc |
index 24846526ea75a43a2a1ee3d4bed777410d137193..390f452e858c5fa21febe736d742b9bb0c03724b 100644 |
--- a/runtime/vm/pages.cc |
+++ b/runtime/vm/pages.cc |
@@ -169,6 +169,8 @@ PageSpace::PageSpace(Heap* heap, |
FLAG_old_gen_growth_time_ratio), |
gc_time_micros_(0), |
collections_(0) { |
+ // We aren't holding the lock but no one can reference us yet. |
+ UpdateMaxCapacityLocked(); |
} |
@@ -532,6 +534,15 @@ void PageSpace::AbandonBumpAllocation() { |
} |
+void PageSpace::UpdateMaxCapacityLocked() { |
+ ASSERT(heap_ != NULL); |
+ ASSERT(heap_->isolate() != NULL); |
+ Isolate* isolate = heap_->isolate(); |
+ isolate->GetHeapOldCapacityMaxMetric()->SetValue( |
+ static_cast<int64_t>(usage_.capacity_in_words) * kWordSize); |
+} |
+ |
+ |
bool PageSpace::Contains(uword addr) const { |
for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
if (it.page()->Contains(addr)) { |