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

Unified Diff: src/heap/heap.cc

Issue 1023153002: Limit rate of full garbage collections triggered by idle notification. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 483b091035fb61fc1023c3ceae383a97d071b5bc..7ca5eebcb719e11ac8b0c7324ff5847c3d4a04de 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4597,6 +4597,7 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
static_cast<double>(base::Time::kMillisecondsPerSecond);
HistogramTimerScope idle_notification_scope(
isolate_->counters()->gc_idle_notification());
+ double current_time = MonotonicallyIncreasingTimeInMs();
GCIdleTimeHandler::HeapState heap_state;
heap_state.contexts_disposed = contexts_disposed_;
@@ -4623,8 +4624,11 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
heap_state.new_space_allocation_throughput_in_bytes_per_ms =
static_cast<size_t>(
tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond());
+ heap_state.last_mark_compact_time =
+ mark_compact_collector()->last_mark_compact_time();
+ heap_state.current_time = static_cast<size_t>(current_time);
rmcilroy 2015/03/20 14:56:08 I'm slightly hesitent at setting current_time as a
- double idle_time_in_ms = deadline_in_ms - MonotonicallyIncreasingTimeInMs();
+ double idle_time_in_ms = deadline_in_ms - current_time;
GCIdleTimeAction action =
gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state);
isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(
@@ -4679,7 +4683,7 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
break;
}
- double current_time = MonotonicallyIncreasingTimeInMs();
+ current_time = MonotonicallyIncreasingTimeInMs();
last_idle_notification_time_ = current_time;
double deadline_difference = deadline_in_ms - current_time;

Powered by Google App Engine
This is Rietveld 408576698