Commit b325f7ec authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Limit number of compaction tasks

Use similar strategy to scavenger when calculating number of parallel
compaction tasks. Do not add task for each page but every fourth page.

Bug: chromium:1051883
Change-Id: Iaba3046de9c9a3ab63c0e7afcc6e4a9c398c5a10
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2054097Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66260}
parent 3fb9a70b
...@@ -387,8 +387,9 @@ int NumberOfAvailableCores() { ...@@ -387,8 +387,9 @@ int NumberOfAvailableCores() {
int MarkCompactCollectorBase::NumberOfParallelCompactionTasks(int pages) { int MarkCompactCollectorBase::NumberOfParallelCompactionTasks(int pages) {
DCHECK_GT(pages, 0); DCHECK_GT(pages, 0);
int tasks = int tasks = FLAG_parallel_compaction ? Min(NumberOfAvailableCores(),
FLAG_parallel_compaction ? Min(NumberOfAvailableCores(), pages) : 1; pages / (MB / Page::kPageSize) + 1)
: 1;
if (!heap_->CanExpandOldGeneration( if (!heap_->CanExpandOldGeneration(
static_cast<size_t>(tasks * Page::kPageSize))) { static_cast<size_t>(tasks * Page::kPageSize))) {
// Optimize for memory usage near the heap limit. // Optimize for memory usage near the heap limit.
......
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