summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaƫl Zasso <targos@protonmail.com>2017-10-25 15:52:20 +0200
committerGibson Fahnestock <gibfahn@gmail.com>2017-10-31 00:15:14 +0000
commit5787f5331f26084d818639ea8700370dc22f0996 (patch)
tree30afaa8f76e37996a8d0ac2ee19fd56632ac3d6d
parentd6619b9ad404113cfb7734ec0badbfea8af695e9 (diff)
downloadnode-new-5787f5331f26084d818639ea8700370dc22f0996.tar.gz
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 <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48312} Refs: https://github.com/v8/v8/commit/2c75616028e75883e28df2c6d8dd2a6bfe47f718 Refs: https://github.com/nodejs/help/issues/917#issuecomment-339292642 Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: https://github.com/nodejs/node/pull/16490 Backport-PR-URL: https://github.com/nodejs/node/pull/16569 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
-rw-r--r--deps/v8/include/v8-version.h2
-rw-r--r--deps/v8/src/heap/heap.cc6
-rw-r--r--deps/v8/src/heap/spaces.h5
3 files changed, 12 insertions, 1 deletions
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index b2c1e5384e..19adac7024 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 1
#define V8_BUILD_NUMBER 534
-#define V8_PATCH_LEVEL 42
+#define V8_PATCH_LEVEL 43
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
diff --git a/deps/v8/src/heap/heap.cc b/deps/v8/src/heap/heap.cc
index 65526f748c..04de6ea6b6 100644
--- a/deps/v8/src/heap/heap.cc
+++ b/deps/v8/src/heap/heap.cc
@@ -1716,6 +1716,12 @@ void Heap::Scavenge() {
IncrementalMarking::PauseBlackAllocationScope pause_black_allocation(
incremental_marking());
+ if (mark_compact_collector()->sweeper().sweeping_in_progress() &&
+ memory_allocator_->unmapper()->NumberOfDelayedChunks() >
+ kMaxSemiSpaceSizeInKB / Page::kPageSize) {
+ mark_compact_collector()->EnsureSweepingCompleted();
+ }
+
mark_compact_collector()->sweeper().EnsureNewSpaceCompleted();
SetGCState(SCAVENGE);
diff --git a/deps/v8/src/heap/spaces.h b/deps/v8/src/heap/spaces.h
index 2ae089b401..c9be48bb3a 100644
--- a/deps/v8/src/heap/spaces.h
+++ b/deps/v8/src/heap/spaces.h
@@ -1226,6 +1226,11 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
bool has_delayed_chunks() { return delayed_regular_chunks_.size() > 0; }
+ int NumberOfDelayedChunks() {
+ base::LockGuard<base::Mutex> guard(&mutex_);
+ return static_cast<int>(delayed_regular_chunks_.size());
+ }
+
private:
static const int kReservedQueueingSlots = 64;
static const int kMaxUnmapperTasks = 24;