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

Unified Diff: src/heap/heap.cc

Issue 1257833005: Use conservative heap growing factor for background tab. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment Created 5 years, 4 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 0432ee71fa0c329e6c1bf6e690883ab26f211a75..6a4acda903ed8cb6e7a95288b041f79197114b81 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -109,6 +109,7 @@ Heap::Heap()
#endif // DEBUG
old_generation_allocation_limit_(initial_old_generation_size_),
old_gen_exhausted_(false),
+ optimize_for_memory_usage_(false),
inline_allocation_disabled_(false),
store_buffer_rebuilder_(store_buffer()),
hidden_string_(NULL),
@@ -4906,6 +4907,9 @@ void Heap::CheckAndNotifyBackgroundIdleNotification(double idle_time_in_ms,
event.can_start_incremental_gc = incremental_marking()->IsStopped() &&
incremental_marking()->CanBeActivated();
memory_reducer_.NotifyBackgroundIdleNotification(event);
+ optimize_for_memory_usage_ = true;
+ } else {
+ optimize_for_memory_usage_ = false;
}
}
@@ -5601,7 +5605,7 @@ void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
}
if (freed_global_handles >= kFreedGlobalHandlesThreshold ||
- memory_reducer_.ShouldGrowHeapSlowly()) {
+ memory_reducer_.ShouldGrowHeapSlowly() || optimize_for_memory_usage_) {
factor = Min(factor, kConservativeHeapGrowingFactor);
}
« 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