Commit ca9209d7 authored by ulan's avatar ulan Committed by Commit bot

[heap] Special handling for small heaps in eager finalization of

incremental marking.

BUG=chromium:671994

Review-Url: https://codereview.chromium.org/2565173004
Cr-Commit-Position: refs/heads/master@{#41666}
parent cd23d677
......@@ -1827,11 +1827,15 @@ class Heap {
// performace reasons. If the overshoot is too large then we are more
// eager to finalize incremental marking.
inline bool AllocationLimitOvershotByLargeMargin() {
// This guards against too eager finalization in small heaps.
// The number is chosen based on v8.browsing_mobile on Nexus 7v2.
size_t kMarginForSmallHeaps = 32u * MB;
if (old_generation_allocation_limit_ >= PromotedTotalSize()) return false;
uint64_t overshoot = PromotedTotalSize() - old_generation_allocation_limit_;
// Overshoot margin is 50% of allocation limit or half-way to the max heap.
// Overshoot margin is 50% of allocation limit or half-way to the max heap
// with special handling of small heaps.
uint64_t margin =
Min(old_generation_allocation_limit_ / 2,
Min(Max(old_generation_allocation_limit_ / 2, kMarginForSmallHeaps),
(max_old_generation_size_ - old_generation_allocation_limit_) / 2);
return overshoot >= margin;
}
......
......@@ -7066,7 +7066,7 @@ HEAP_TEST(Regress670675) {
}
size_t array_length = Page::kPageSize / kPointerSize + 100;
size_t n = heap->OldGenerationSpaceAvailable() / array_length;
for (size_t i = 0; i < n + 10; i++) {
for (size_t i = 0; i < n + 40; i++) {
{
HandleScope inner_scope(isolate);
isolate->factory()->NewFixedArray(static_cast<int>(array_length));
......
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