Skip to content

Commit 5787f53

Browse files
targosgibfahn
authored andcommitted
deps: cherry-pick 2c75616 from upstream V8
Original commit message: [heap] Ensure progress in unmapping memory chunks. If sweeping is not making progress and there are many young generation GCs happening, then this can lead to accumulation of memory chunks in the unmapper queue. Bug: chromium:771966 Change-Id: Ief73ada0d17198a80b668850c6d2e7ea413113e7 Reviewed-on: https://chromium-review.googlesource.com/702479 Reviewed-by: Michael Lippautz <[email protected]> Commit-Queue: Ulan Degenbaev <[email protected]> Cr-Commit-Position: refs/heads/master@{#48312} Refs: v8/v8@2c75616 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Backport-PR-URL: #16569 Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent d6619b9 commit 5787f53

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 534
14-
#define V8_PATCH_LEVEL 42
14+
#define V8_PATCH_LEVEL 43
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/heap/heap.cc

+6
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,12 @@ void Heap::Scavenge() {
17161716
IncrementalMarking::PauseBlackAllocationScope pause_black_allocation(
17171717
incremental_marking());
17181718

1719+
if (mark_compact_collector()->sweeper().sweeping_in_progress() &&
1720+
memory_allocator_->unmapper()->NumberOfDelayedChunks() >
1721+
kMaxSemiSpaceSizeInKB / Page::kPageSize) {
1722+
mark_compact_collector()->EnsureSweepingCompleted();
1723+
}
1724+
17191725
mark_compact_collector()->sweeper().EnsureNewSpaceCompleted();
17201726

17211727
SetGCState(SCAVENGE);

deps/v8/src/heap/spaces.h

+5
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,11 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
12261226

12271227
bool has_delayed_chunks() { return delayed_regular_chunks_.size() > 0; }
12281228

1229+
int NumberOfDelayedChunks() {
1230+
base::LockGuard<base::Mutex> guard(&mutex_);
1231+
return static_cast<int>(delayed_regular_chunks_.size());
1232+
}
1233+
12291234
private:
12301235
static const int kReservedQueueingSlots = 64;
12311236
static const int kMaxUnmapperTasks = 24;

0 commit comments

Comments
 (0)