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

Unified Diff: src/heap/heap.cc

Issue 1143133004: Reland Set lower allocation limit in idle notification only if no GC happend recently. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 72769fe385a2f98e1ff633fef759667d3cb3d1f6..e66ae93ae5b2160f28fbc26f356787691fe64b18 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -133,6 +133,7 @@ Heap::Heap()
marking_time_(0.0),
sweeping_time_(0.0),
last_idle_notification_time_(0.0),
+ last_gc_time_(0.0),
mark_compact_collector_(this),
store_buffer_(this),
marking_(this),
@@ -725,6 +726,7 @@ void Heap::GarbageCollectionEpilogue() {
// Remember the last top pointer so that we can later find out
// whether we allocated in new space since the last GC.
new_space_top_after_last_gc_ = new_space()->top();
+ last_gc_time_ = MonotonicallyIncreasingTimeInMs();
}
@@ -4612,6 +4614,8 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
static_cast<size_t>(idle_time_in_ms) >
GCIdleTimeHandler::kMaxFrameRenderingIdleTime;
+ static const double kLastGCTimeTreshold = 1000;
+
GCIdleTimeHandler::HeapState heap_state;
heap_state.contexts_disposed = contexts_disposed_;
heap_state.contexts_disposal_rate =
@@ -4620,7 +4624,8 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
heap_state.incremental_marking_stopped = incremental_marking()->IsStopped();
// TODO(ulan): Start incremental marking only for large heaps.
intptr_t limit = old_generation_allocation_limit_;
- if (is_long_idle_notification) {
+ if (is_long_idle_notification &&
+ (start_ms - last_gc_time_ > kLastGCTimeTreshold)) {
limit = idle_old_generation_allocation_limit_;
}
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698