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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/compiler_stats.h" 8 #include "vm/compiler_stats.h"
9 #include "vm/gc_marker.h" 9 #include "vm/gc_marker.h"
10 #include "vm/gc_sweeper.h" 10 #include "vm/gc_sweeper.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 tasks_(0), 162 tasks_(0),
163 #if defined(DEBUG) 163 #if defined(DEBUG)
164 iterating_thread_(NULL), 164 iterating_thread_(NULL),
165 #endif 165 #endif
166 page_space_controller_(heap, 166 page_space_controller_(heap,
167 FLAG_old_gen_growth_space_ratio, 167 FLAG_old_gen_growth_space_ratio,
168 FLAG_old_gen_growth_rate, 168 FLAG_old_gen_growth_rate,
169 FLAG_old_gen_growth_time_ratio), 169 FLAG_old_gen_growth_time_ratio),
170 gc_time_micros_(0), 170 gc_time_micros_(0),
171 collections_(0) { 171 collections_(0) {
172 // We aren't holding the lock but no one can reference us yet.
173 UpdateMaxCapacityLocked();
172 } 174 }
173 175
174 176
175 PageSpace::~PageSpace() { 177 PageSpace::~PageSpace() {
176 { 178 {
177 MonitorLocker ml(tasks_lock()); 179 MonitorLocker ml(tasks_lock());
178 while (tasks() > 0) { 180 while (tasks() > 0) {
179 ml.Wait(); 181 ml.Wait();
180 } 182 }
181 } 183 }
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 527
526 void PageSpace::AbandonBumpAllocation() { 528 void PageSpace::AbandonBumpAllocation() {
527 if (bump_top_ < bump_end_) { 529 if (bump_top_ < bump_end_) {
528 freelist_[HeapPage::kData].Free(bump_top_, bump_end_ - bump_top_); 530 freelist_[HeapPage::kData].Free(bump_top_, bump_end_ - bump_top_);
529 bump_top_ = 0; 531 bump_top_ = 0;
530 bump_end_ = 0; 532 bump_end_ = 0;
531 } 533 }
532 } 534 }
533 535
534 536
537 void PageSpace::UpdateMaxCapacityLocked() {
538 ASSERT(heap_ != NULL);
539 ASSERT(heap_->isolate() != NULL);
540 Isolate* isolate = heap_->isolate();
541 isolate->GetHeapOldCapacityMaxMetric()->SetValue(
542 static_cast<int64_t>(usage_.capacity_in_words) * kWordSize);
543 }
544
545
535 bool PageSpace::Contains(uword addr) const { 546 bool PageSpace::Contains(uword addr) const {
536 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { 547 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) {
537 if (it.page()->Contains(addr)) { 548 if (it.page()->Contains(addr)) {
538 return true; 549 return true;
539 } 550 }
540 } 551 }
541 return false; 552 return false;
542 } 553 }
543 554
544 555
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 return 0; 1190 return 0;
1180 } else { 1191 } else {
1181 ASSERT(total_time >= gc_time); 1192 ASSERT(total_time >= gc_time);
1182 int result = static_cast<int>((static_cast<double>(gc_time) / 1193 int result = static_cast<int>((static_cast<double>(gc_time) /
1183 static_cast<double>(total_time)) * 100); 1194 static_cast<double>(total_time)) * 100);
1184 return result; 1195 return result;
1185 } 1196 }
1186 } 1197 }
1187 1198
1188 } // namespace dart 1199 } // namespace dart
OLDNEW
« 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