Commit 9348047a authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Fix unmapper logging.

Change-Id: I65b5f879bfc1efb2ed3178cdfcb3b6a03b91e12a
Reviewed-on: https://chromium-review.googlesource.com/c/1305933Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57102}
parent f942791b
......@@ -192,11 +192,10 @@ size_t Heap::CommittedOldGenerationMemory() {
return total + lo_space_->Size();
}
size_t Heap::CommittedMemoryOfHeapAndUnmapper() {
size_t Heap::CommittedMemoryOfUnmapper() {
if (!HasBeenSetUp()) return 0;
return CommittedMemory() +
memory_allocator()->unmapper()->CommittedBufferedMemory();
return memory_allocator()->unmapper()->CommittedBufferedMemory();
}
size_t Heap::CommittedMemory() {
......@@ -374,9 +373,9 @@ void Heap::PrintShortHeapStatistics() {
this->SizeOfObjects() / KB, this->Available() / KB,
this->CommittedMemory() / KB);
PrintIsolate(isolate_,
"Unmapper buffering %d chunks of committed: %6" PRIuS " KB\n",
memory_allocator()->unmapper()->NumberOfChunks(),
CommittedMemoryOfHeapAndUnmapper() / KB);
"Unmapper buffering %zu chunks of committed: %6" PRIuS " KB\n",
memory_allocator()->unmapper()->NumberOfCommittedChunks(),
CommittedMemoryOfUnmapper() / KB);
PrintIsolate(isolate_, "External memory reported: %6" PRId64 " KB\n",
isolate()->isolate_data()->external_memory_ / KB);
PrintIsolate(isolate_, "Backing store memory: %6" PRIuS " KB\n",
......
......@@ -999,9 +999,8 @@ class Heap {
// Returns the capacity of the old generation.
size_t OldGenerationCapacity();
// Returns the amount of memory currently committed for the heap and memory
// held alive by the unmapper.
size_t CommittedMemoryOfHeapAndUnmapper();
// Returns the amount of memory currently held alive by the unmapper.
size_t CommittedMemoryOfUnmapper();
// Returns the amount of memory currently committed for the heap.
size_t CommittedMemory();
......
......@@ -360,6 +360,11 @@ void MemoryAllocator::Unmapper::TearDown() {
}
}
size_t MemoryAllocator::Unmapper::NumberOfCommittedChunks() {
base::MutexGuard guard(&mutex_);
return chunks_[kRegular].size() + chunks_[kNonRegular].size();
}
int MemoryAllocator::Unmapper::NumberOfChunks() {
base::MutexGuard guard(&mutex_);
size_t result = 0;
......
......@@ -1205,6 +1205,7 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
void PrepareForMarkCompact();
void EnsureUnmappingCompleted();
void TearDown();
size_t NumberOfCommittedChunks();
int NumberOfChunks();
size_t CommittedBufferedMemory();
......
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