Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(948)

Unified Diff: runtime/vm/pages.cc

Issue 1391473002: Add Metrics for heap high water marks (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698