Commit cfd063b5 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Remove detached contexts heuristic from the memory reducer

When the memory reducer decides whether to do the next GC or not, it
takes into account the number of detached contexts. This may lead to
redundant GCs if the detached contexts are leaking and stay reachable.

With the unified heap all unreachable detached contexts are freed in
one GC, so this heuristic is no longer necessary.

Bug: chromium:1072746
Change-Id: I869fd6ca2008135dfea39e7ceeb01fdc9ead22be
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2187493Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67653}
parent cc14c706
......@@ -1607,11 +1607,9 @@ bool Heap::CollectGarbage(AllocationSpace space,
// Trigger one more GC if
// - this GC decreased committed memory,
// - there is high fragmentation,
// - there are live detached contexts.
event.next_gc_likely_to_collect_more =
(committed_memory_before > committed_memory_after + MB) ||
HasHighFragmentation(used_memory_after, committed_memory_after) ||
(detached_contexts().length() > 0);
HasHighFragmentation(used_memory_after, committed_memory_after);
event.committed_memory = committed_memory_after;
if (deserialization_complete_) {
memory_reducer_->NotifyMarkCompact(event);
......
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