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

Unified Diff: runtime/vm/heap.cc

Issue 1384003004: Add max post-gc heap usage metrics (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/heap.h ('k') | runtime/vm/metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 39d34782baff81a4487e710be31c5551cc275077..670c86844caed7e4c7c0b5183a84b2d33539387b 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -453,6 +453,16 @@ void Heap::UpdatePretenurePolicy() {
}
+void Heap::UpdateGlobalMaxUsed() {
+ ASSERT(isolate_ != NULL);
+ // We are accessing the used in words count for both new and old space
+ // without synchronizing. The value of this metric is approximate.
+ isolate_->GetHeapGlobalUsedMaxMetric()->SetValue(
+ (UsedInWords(Heap::kNew) * kWordSize) +
+ (UsedInWords(Heap::kOld) * kWordSize));
+}
+
+
void Heap::SetGrowthControlState(bool state) {
old_space_.SetGrowthControlState(state);
}
@@ -568,8 +578,8 @@ bool Heap::VerifyGC(MarkExpectation mark_expectation) const {
void Heap::PrintSizes() const {
- OS::PrintErr("New space (%" Pd "k of %" Pd "k) "
- "Old space (%" Pd "k of %" Pd "k)\n",
+ OS::PrintErr("New space (%" Pd64 "k of %" Pd64 "k) "
+ "Old space (%" Pd64 "k of %" Pd64 "k)\n",
(UsedInWords(kNew) / KBInWords),
(CapacityInWords(kNew) / KBInWords),
(UsedInWords(kOld) / KBInWords),
@@ -577,21 +587,23 @@ void Heap::PrintSizes() const {
}
-intptr_t Heap::UsedInWords(Space space) const {
+int64_t Heap::UsedInWords(Space space) const {
return space == kNew ? new_space_.UsedInWords() : old_space_.UsedInWords();
}
-intptr_t Heap::CapacityInWords(Space space) const {
+int64_t Heap::CapacityInWords(Space space) const {
return space == kNew ? new_space_.CapacityInWords() :
old_space_.CapacityInWords();
}
-intptr_t Heap::ExternalInWords(Space space) const {
+
+int64_t Heap::ExternalInWords(Space space) const {
return space == kNew ? new_space_.ExternalInWords() :
old_space_.ExternalInWords();
}
+
int64_t Heap::GCTimeInMicros(Space space) const {
if (space == kNew) {
return new_space_.gc_time_micros();
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698