Commit 320ee1b8 authored by hpayer's avatar hpayer Committed by Commit bot

[heap] Enfoce tighter allocation limit for large object allocations.

BUG=chromium:574953
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33179}
parent 45850f40
......@@ -942,7 +942,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
if (collector == MARK_COMPACTOR && !ShouldFinalizeIncrementalMarking() &&
!ShouldAbortIncrementalMarking() && !incremental_marking()->IsStopped() &&
!incremental_marking()->should_hurry() && FLAG_incremental_marking) {
!incremental_marking()->should_hurry() && FLAG_incremental_marking &&
OldGenerationAllocationLimitReached()) {
// Make progress in incremental marking.
const intptr_t kStepSizeWhenDelayedByScavenge = 1 * MB;
incremental_marking()->Step(kStepSizeWhenDelayedByScavenge,
......
......@@ -825,7 +825,7 @@ class Heap {
// TODO(hpayer): There is still a missmatch between capacity and actual
// committed memory size.
bool CanExpandOldGeneration(int size) {
bool CanExpandOldGeneration(int size = 0) {
if (force_oom_) return false;
return (CommittedOldGenerationMemory() + size) < MaxOldGenerationSize();
}
......
......@@ -3100,8 +3100,7 @@ AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
Executability executable) {
// Check if we want to force a GC before growing the old space further.
// If so, fail the allocation.
if (!heap()->always_allocate() &&
!heap()->CanExpandOldGeneration(object_size)) {
if (!heap()->CanExpandOldGeneration(object_size)) {
return AllocationResult::Retry(identity());
}
......
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