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() { ...@@ -192,11 +192,10 @@ size_t Heap::CommittedOldGenerationMemory() {
return total + lo_space_->Size(); return total + lo_space_->Size();
} }
size_t Heap::CommittedMemoryOfHeapAndUnmapper() { size_t Heap::CommittedMemoryOfUnmapper() {
if (!HasBeenSetUp()) return 0; if (!HasBeenSetUp()) return 0;
return CommittedMemory() + return memory_allocator()->unmapper()->CommittedBufferedMemory();
memory_allocator()->unmapper()->CommittedBufferedMemory();
} }
size_t Heap::CommittedMemory() { size_t Heap::CommittedMemory() {
...@@ -374,9 +373,9 @@ void Heap::PrintShortHeapStatistics() { ...@@ -374,9 +373,9 @@ void Heap::PrintShortHeapStatistics() {
this->SizeOfObjects() / KB, this->Available() / KB, this->SizeOfObjects() / KB, this->Available() / KB,
this->CommittedMemory() / KB); this->CommittedMemory() / KB);
PrintIsolate(isolate_, PrintIsolate(isolate_,
"Unmapper buffering %d chunks of committed: %6" PRIuS " KB\n", "Unmapper buffering %zu chunks of committed: %6" PRIuS " KB\n",
memory_allocator()->unmapper()->NumberOfChunks(), memory_allocator()->unmapper()->NumberOfCommittedChunks(),
CommittedMemoryOfHeapAndUnmapper() / KB); CommittedMemoryOfUnmapper() / KB);
PrintIsolate(isolate_, "External memory reported: %6" PRId64 " KB\n", PrintIsolate(isolate_, "External memory reported: %6" PRId64 " KB\n",
isolate()->isolate_data()->external_memory_ / KB); isolate()->isolate_data()->external_memory_ / KB);
PrintIsolate(isolate_, "Backing store memory: %6" PRIuS " KB\n", PrintIsolate(isolate_, "Backing store memory: %6" PRIuS " KB\n",
......
...@@ -999,9 +999,8 @@ class Heap { ...@@ -999,9 +999,8 @@ class Heap {
// Returns the capacity of the old generation. // Returns the capacity of the old generation.
size_t OldGenerationCapacity(); size_t OldGenerationCapacity();
// Returns the amount of memory currently committed for the heap and memory // Returns the amount of memory currently held alive by the unmapper.
// held alive by the unmapper. size_t CommittedMemoryOfUnmapper();
size_t CommittedMemoryOfHeapAndUnmapper();
// Returns the amount of memory currently committed for the heap. // Returns the amount of memory currently committed for the heap.
size_t CommittedMemory(); size_t CommittedMemory();
......
...@@ -360,6 +360,11 @@ void MemoryAllocator::Unmapper::TearDown() { ...@@ -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() { int MemoryAllocator::Unmapper::NumberOfChunks() {
base::MutexGuard guard(&mutex_); base::MutexGuard guard(&mutex_);
size_t result = 0; size_t result = 0;
......
...@@ -1205,6 +1205,7 @@ class V8_EXPORT_PRIVATE MemoryAllocator { ...@@ -1205,6 +1205,7 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
void PrepareForMarkCompact(); void PrepareForMarkCompact();
void EnsureUnmappingCompleted(); void EnsureUnmappingCompleted();
void TearDown(); void TearDown();
size_t NumberOfCommittedChunks();
int NumberOfChunks(); int NumberOfChunks();
size_t CommittedBufferedMemory(); 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