Commit c65e6202 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Be more restrictive about fast promotion mode

Exclude memory reducing scenarios and apply minimum percentage to absolute
sizes wrt. capacity rather then relative survival rate.

R=ulan@chromium.org
BUG=chromium:693413

Change-Id: I30cac99a2ce72227e269d72f52a459d4be6234a5
Reviewed-on: https://chromium-review.googlesource.com/445737Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43346}
parent 5738535e
......@@ -1800,13 +1800,16 @@ void Heap::Scavenge() {
}
void Heap::ComputeFastPromotionMode(double survival_rate) {
const size_t survived_in_new_space =
survived_last_scavenge_ * 100 / new_space_->Capacity();
fast_promotion_mode_ =
!FLAG_optimize_for_size && FLAG_fast_promotion_new_space &&
new_space_->IsAtMaximumCapacity() &&
survival_rate >= kMinPromotedPercentForFastPromotionMode;
!ShouldReduceMemory() && new_space_->IsAtMaximumCapacity() &&
survived_in_new_space >= kMinPromotedPercentForFastPromotionMode;
if (FLAG_trace_gc_verbose) {
PrintIsolate(isolate(), "Fast promotion mode: %s survival rate: %f%%\n",
fast_promotion_mode_ ? "true" : "false", survival_rate);
PrintIsolate(
isolate(), "Fast promotion mode: %s survival rate: %" PRIuS "%%\n",
fast_promotion_mode_ ? "true" : "false", survived_in_new_space);
}
}
......@@ -5255,7 +5258,6 @@ const double Heap::kMaxHeapGrowingFactorMemoryConstrained = 2.0;
const double Heap::kMaxHeapGrowingFactorIdle = 1.5;
const double Heap::kConservativeHeapGrowingFactor = 1.3;
const double Heap::kTargetMutatorUtilization = 0.97;
const double Heap::kMinPromotedPercentForFastPromotionMode = 90;
// Given GC speed in bytes per ms, the allocation throughput in bytes per ms
// (mutator speed), this function returns the heap growing factor that will
......
......@@ -648,7 +648,7 @@ class Heap {
// The minimum size of a HeapObject on the heap.
static const int kMinObjectSizeInWords = 2;
static const double kMinPromotedPercentForFastPromotionMode;
static const int kMinPromotedPercentForFastPromotionMode = 90;
STATIC_ASSERT(kUndefinedValueRootIndex ==
Internals::kUndefinedValueRootIndex);
......
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