Commit 0cf86bd2 authored by ulan's avatar ulan Committed by Commit bot

Use conservative heap growing factor for background tab.

BUG=chromium:515873
LOG=NO

Review URL: https://codereview.chromium.org/1257833005

Cr-Commit-Position: refs/heads/master@{#29994}
parent 880a6489
...@@ -109,6 +109,7 @@ Heap::Heap() ...@@ -109,6 +109,7 @@ Heap::Heap()
#endif // DEBUG #endif // DEBUG
old_generation_allocation_limit_(initial_old_generation_size_), old_generation_allocation_limit_(initial_old_generation_size_),
old_gen_exhausted_(false), old_gen_exhausted_(false),
optimize_for_memory_usage_(false),
inline_allocation_disabled_(false), inline_allocation_disabled_(false),
store_buffer_rebuilder_(store_buffer()), store_buffer_rebuilder_(store_buffer()),
hidden_string_(NULL), hidden_string_(NULL),
...@@ -4906,6 +4907,9 @@ void Heap::CheckAndNotifyBackgroundIdleNotification(double idle_time_in_ms, ...@@ -4906,6 +4907,9 @@ void Heap::CheckAndNotifyBackgroundIdleNotification(double idle_time_in_ms,
event.can_start_incremental_gc = incremental_marking()->IsStopped() && event.can_start_incremental_gc = incremental_marking()->IsStopped() &&
incremental_marking()->CanBeActivated(); incremental_marking()->CanBeActivated();
memory_reducer_.NotifyBackgroundIdleNotification(event); 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, ...@@ -5601,7 +5605,7 @@ void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
} }
if (freed_global_handles >= kFreedGlobalHandlesThreshold || if (freed_global_handles >= kFreedGlobalHandlesThreshold ||
memory_reducer_.ShouldGrowHeapSlowly()) { memory_reducer_.ShouldGrowHeapSlowly() || optimize_for_memory_usage_) {
factor = Min(factor, kConservativeHeapGrowingFactor); factor = Min(factor, kConservativeHeapGrowingFactor);
} }
......
...@@ -1806,6 +1806,10 @@ class Heap { ...@@ -1806,6 +1806,10 @@ class Heap {
// last GC. // last GC.
bool old_gen_exhausted_; bool old_gen_exhausted_;
// Indicates that memory usage is more important than latency.
// TODO(ulan): Merge it with memory reducer once chromium:490559 is fixed.
bool optimize_for_memory_usage_;
// Indicates that inline bump-pointer allocation has been globally disabled // Indicates that inline bump-pointer allocation has been globally disabled
// for all spaces. This is used to disable allocations in generated code. // for all spaces. This is used to disable allocations in generated code.
bool inline_allocation_disabled_; bool inline_allocation_disabled_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment