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

Unified Diff: runtime/vm/pages.cc

Issue 11734028: - Consolidate verbose-gc output to be a single line which can be imported easily into spreadsheets. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 12 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
Index: runtime/vm/pages.cc
===================================================================
--- runtime/vm/pages.cc (revision 16586)
+++ runtime/vm/pages.cc (working copy)
@@ -118,7 +118,6 @@
max_capacity_(max_capacity),
capacity_(0),
in_use_(0),
- count_(0),
sweeping_(false),
page_space_controller_(FLAG_heap_growth_space_ratio,
FLAG_heap_growth_rate,
@@ -402,7 +401,7 @@
}
-void PageSpace::MarkSweep(bool invoke_api_callbacks, const char* gc_reason) {
+void PageSpace::MarkSweep(bool invoke_api_callbacks) {
// MarkSweep is not reentrant. Make sure that is the case.
ASSERT(!sweeping_);
sweeping_ = true;
@@ -426,21 +425,21 @@
OS::PrintErr(" done.\n");
}
- if (FLAG_verbose_gc) {
- OS::PrintErr("Start mark sweep for %s collection\n", gc_reason);
- }
- Timer timer(true, "MarkSweep");
- timer.Start();
- int64_t start = OS::GetCurrentTimeMillis();
+ int64_t start = OS::GetCurrentTimeMicros();
// Mark all reachable old-gen objects.
GCMarker marker(heap_);
marker.MarkObjects(isolate, this, invoke_api_callbacks);
+ int64_t mid1 = OS::GetCurrentTimeMicros();
+
// Reset the bump allocation page to unused.
// Reset the freelists and setup sweeping.
freelist_[HeapPage::kData].Reset();
freelist_[HeapPage::kExecutable].Reset();
+
+ int64_t mid2 = OS::GetCurrentTimeMicros();
+
GCSweeper sweeper(heap_);
intptr_t in_use = 0;
@@ -459,6 +458,8 @@
page = next_page;
}
+ int64_t mid3 = OS::GetCurrentTimeMicros();
+
prev_page = NULL;
page = large_pages_;
while (page != NULL) {
@@ -478,22 +479,16 @@
intptr_t in_use_before = in_use_;
in_use_ = in_use;
- int64_t end = OS::GetCurrentTimeMillis();
- timer.Stop();
+ int64_t end = OS::GetCurrentTimeMicros();
// Record signals for growth control.
page_space_controller_.EvaluateGarbageCollection(in_use_before, in_use,
start, end);
- if (FLAG_verbose_gc) {
- const intptr_t KB2 = KB / 2;
- OS::PrintErr("Mark-Sweep[%d]: %"Pd64"us (%"Pd"K -> %"Pd"K, %"Pd"K)\n",
- count_,
- timer.TotalElapsedTime(),
- (in_use_before + (KB2)) / KB,
- (in_use + (KB2)) / KB,
- (capacity_ + KB2) / KB);
- }
+ heap_->RecordTime(0, mid1 - start);
+ heap_->RecordTime(1, mid2 - mid1);
+ heap_->RecordTime(2, mid3 - mid2);
+ heap_->RecordTime(3, end - mid3);
if (FLAG_print_free_list_after_gc) {
OS::Print("Data Freelist (after GC):\n");
@@ -512,7 +507,6 @@
isolate->heap()->trace()->TraceMarkSweepFinish();
}
- count_++;
// Done, reset the marker.
ASSERT(sweeping_);
sweeping_ = false;
@@ -566,33 +560,22 @@
history_.GarbageCollectionTimeFraction();
bool enough_free_time =
(garbage_collection_time_fraction <= garbage_collection_time_ratio_);
+
+ Heap* heap = Isolate::Current()->heap();
if (enough_free_space && enough_free_time) {
grow_heap_ = 0;
} else {
- if (FLAG_verbose_gc) {
- OS::PrintErr("PageSpaceController: ");
- if (!enough_free_space) {
- OS::PrintErr("free space %d%% < %d%%",
- collected_garbage_ratio,
- heap_growth_ratio_);
- }
- if (!enough_free_space && !enough_free_time) {
- OS::PrintErr(", ");
- }
- if (!enough_free_time) {
- OS::PrintErr("garbage collection time %d%% > %d%%",
- garbage_collection_time_fraction,
- garbage_collection_time_ratio_);
- }
- OS::PrintErr("\n");
- }
intptr_t growth_target = static_cast<intptr_t>(in_use_after /
desired_utilization_);
intptr_t growth_in_bytes = Utils::RoundUp(growth_target - in_use_after,
PageSpace::kPageSize);
int growth_in_pages = growth_in_bytes / PageSpace::kPageSize;
grow_heap_ = Utils::Maximum(growth_in_pages, heap_growth_rate_);
+ heap->RecordData(2, growth_in_pages);
}
+ heap->RecordData(0, collected_garbage_ratio);
+ heap->RecordData(1, garbage_collection_time_fraction);
+ heap->RecordData(3, grow_heap_);
}

Powered by Google App Engine
This is Rietveld 408576698