[heap] Start unmapper tasks for freed young large pages
This fixes the case of accumulating large pages after scavenges if there is no mark-compact GC. Bug: chromium:934453 Change-Id: Ide57c64ae985cc79ad9f477a759ab729f894c73b Reviewed-on: https://chromium-review.googlesource.com/c/1482740 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#59838}
This commit is contained in:
parent
942dc58506
commit
b6c0c44766
@ -3797,12 +3797,14 @@ void NewLargeObjectSpace::FreeDeadObjects(
|
||||
const std::function<bool(HeapObject)>& is_dead) {
|
||||
bool is_marking = heap()->incremental_marking()->IsMarking();
|
||||
size_t surviving_object_size = 0;
|
||||
bool freed_pages = false;
|
||||
for (auto it = begin(); it != end();) {
|
||||
LargePage* page = *it;
|
||||
it++;
|
||||
HeapObject object = page->GetObject();
|
||||
size_t size = static_cast<size_t>(object->Size());
|
||||
if (is_dead(object)) {
|
||||
freed_pages = true;
|
||||
RemovePage(page, size);
|
||||
heap()->memory_allocator()->Free<MemoryAllocator::kPreFreeAndQueue>(page);
|
||||
if (FLAG_concurrent_marking && is_marking) {
|
||||
@ -3815,6 +3817,9 @@ void NewLargeObjectSpace::FreeDeadObjects(
|
||||
// Right-trimming does not update the objects_size_ counter. We are lazily
|
||||
// updating it after every GC.
|
||||
objects_size_ = surviving_object_size;
|
||||
if (freed_pages) {
|
||||
heap()->memory_allocator()->unmapper()->FreeQueuedChunks();
|
||||
}
|
||||
}
|
||||
|
||||
void NewLargeObjectSpace::SetCapacity(size_t capacity) {
|
||||
|
Loading…
Reference in New Issue
Block a user