[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/+/2187493
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67653}
This commit is contained in:
Ulan Degenbaev 2020-05-07 11:56:07 +02:00 committed by Commit Bot
parent cc14c706ac
commit cfd063b59e

View File

@ -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);