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

Unified Diff: runtime/vm/scavenger.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/scavenger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index e223803806f2d38d45b262508d6fd043e3ee7c3a..e885b9801e7cf8c877ea03b8abc02333f726927f 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -415,7 +415,7 @@ Scavenger::Scavenger(Heap* heap,
if (to_ == NULL) {
FATAL("Out of memory.\n");
}
-
+ UpdateMaxHeapCapacity();
// Setup local fields.
top_ = FirstObjectStart();
resolved_top_ = top_;
@@ -459,6 +459,7 @@ SemiSpace* Scavenger::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
// isolate to finish scavenge, etc.).
FATAL("Out of memory.\n");
}
+ UpdateMaxHeapCapacity();
top_ = FirstObjectStart();
resolved_top_ = top_;
end_ = to_->end();
@@ -705,6 +706,20 @@ void Scavenger::ProcessToSpace(ScavengerVisitor* visitor) {
}
+void Scavenger::UpdateMaxHeapCapacity() {
+ if (heap_ == NULL) {
+ // Some unit tests.
+ return;
+ }
+ ASSERT(to_ != NULL);
+ ASSERT(heap_ != NULL);
+ Isolate* isolate = heap_->isolate();
+ ASSERT(isolate != NULL);
+ isolate->GetHeapNewCapacityMaxMetric()->SetValue(
+ to_->size_in_words() * kWordSize);
+}
+
+
uword Scavenger::ProcessWeakProperty(RawWeakProperty* raw_weak,
ScavengerVisitor* visitor) {
// The fate of the weak property is determined by its key.
« no previous file with comments | « runtime/vm/scavenger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698