Commit 1d53ad7e authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Allow background threads to expand the heap on tear down

Garbage collection requests from background threads are ignored if
the heap is tearing down. This fixes CanExpandOldGenerationBackground
to check for that case.

Bug: v8:10315
Change-Id: I79b6a4446bf3c9037dbca54849c87f022be76b49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387964
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69666}
parent b22aa786
......@@ -404,7 +404,10 @@ bool Heap::CanExpandOldGeneration(size_t size) {
bool Heap::CanExpandOldGenerationBackground(size_t size) {
if (force_oom_) return false;
return memory_allocator()->Size() + size <= MaxReserved();
// When the heap is tearing down, then GC requests from background threads
// are not served and the threads are allowed to expand the heap to avoid OOM.
return gc_state() == TEAR_DOWN ||
memory_allocator()->Size() + size <= MaxReserved();
}
bool Heap::HasBeenSetUp() const {
......
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