Commit e0d64dc6 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[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/704740Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48338}
parent 228cba7d
......@@ -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:
......@@ -655,6 +659,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),
......@@ -733,6 +739,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;
......
......@@ -395,6 +395,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
......
......@@ -1201,6 +1201,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;
......
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