diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-10-25 15:54:40 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-10-28 13:01:45 +0200 |
commit | edd78f86acc6f7ad90cac18b57b81cbb647daeea (patch) | |
tree | 1a0693f871799f66a823c4013d83baca7a5540b1 /deps | |
parent | cf38d2f402930177225df03fe188dbc8cf30b9da (diff) | |
download | node-new-edd78f86acc6f7ad90cac18b57b81cbb647daeea.tar.gz |
deps: cherry-pick e0d64dc from upstream V8
Original commit message:
[heap] Print the number of chunks in unmapper queue in --trace-gc-nvp
Bug: chromium:771966
Change-Id: I146b279c4713b7dd716c6d55ca5e6c6e23a3ad7e
Reviewed-on: https://chromium-review.googlesource.com/704740
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48338}
Refs: https://github.com/v8/v8/commit/e0d64dc67c6abf36a37efdc6e8e6903bb114ebd3
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
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>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/v8/src/heap/gc-tracer.cc | 8 | ||||
-rw-r--r-- | deps/v8/src/heap/spaces.cc | 9 | ||||
-rw-r--r-- | deps/v8/src/heap/spaces.h | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/deps/v8/src/heap/gc-tracer.cc b/deps/v8/src/heap/gc-tracer.cc index ddfcd07cc1..e14fbb4862 100644 --- a/deps/v8/src/heap/gc-tracer.cc +++ b/deps/v8/src/heap/gc-tracer.cc @@ -490,6 +490,8 @@ void GCTracer::PrintNVP() const { "promotion_rate=%.1f%% " "semi_space_copy_rate=%.1f%% " "new_space_allocation_throughput=%.1f " + "unmapper_chunks=%d " + "unmapper_delayed_chunks=%d " "context_disposal_rate=%.1f\n", duration, spent_in_mutator, current_.TypeName(true), current_.reduce_memory, current_.scopes[Scope::HEAP_PROLOGUE], @@ -520,6 +522,8 @@ void GCTracer::PrintNVP() const { AverageSurvivalRatio(), heap_->promotion_rate_, heap_->semi_space_copied_rate_, NewSpaceAllocationThroughputInBytesPerMillisecond(), + heap_->memory_allocator()->unmapper()->NumberOfChunks(), + heap_->memory_allocator()->unmapper()->NumberOfDelayedChunks(), ContextDisposalRateInMilliseconds()); break; case Event::MINOR_MARK_COMPACTOR: @@ -654,6 +658,8 @@ void GCTracer::PrintNVP() const { "promotion_rate=%.1f%% " "semi_space_copy_rate=%.1f%% " "new_space_allocation_throughput=%.1f " + "unmapper_chunks=%d " + "unmapper_delayed_chunks=%d " "context_disposal_rate=%.1f " "compaction_speed=%.f\n", duration, spent_in_mutator, current_.TypeName(true), @@ -731,6 +737,8 @@ void GCTracer::PrintNVP() const { AverageSurvivalRatio(), heap_->promotion_rate_, heap_->semi_space_copied_rate_, NewSpaceAllocationThroughputInBytesPerMillisecond(), + heap_->memory_allocator()->unmapper()->NumberOfChunks(), + heap_->memory_allocator()->unmapper()->NumberOfDelayedChunks(), ContextDisposalRateInMilliseconds(), CompactionSpeedInBytesPerMillisecond()); break; diff --git a/deps/v8/src/heap/spaces.cc b/deps/v8/src/heap/spaces.cc index 66c63e5863..74fee75673 100644 --- a/deps/v8/src/heap/spaces.cc +++ b/deps/v8/src/heap/spaces.cc @@ -408,6 +408,15 @@ void MemoryAllocator::Unmapper::ReconsiderDelayedChunks() { } } +int MemoryAllocator::Unmapper::NumberOfChunks() { + base::LockGuard<base::Mutex> guard(&mutex_); + size_t result = 0; + for (int i = 0; i < kNumberOfChunkQueues; i++) { + result += chunks_[i].size(); + } + return static_cast<int>(result); +} + bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) { MarkCompactCollector* mc = isolate_->heap()->mark_compact_collector(); // We cannot free a memory chunk in new space while the sweeper is running diff --git a/deps/v8/src/heap/spaces.h b/deps/v8/src/heap/spaces.h index 230a127809..4f4de139e4 100644 --- a/deps/v8/src/heap/spaces.h +++ b/deps/v8/src/heap/spaces.h @@ -1204,6 +1204,8 @@ class V8_EXPORT_PRIVATE MemoryAllocator { return static_cast<int>(delayed_regular_chunks_.size()); } + int NumberOfChunks(); + private: static const int kReservedQueueingSlots = 64; static const int kMaxUnmapperTasks = 24; |