Commit cd31f11d authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[heap] Remove the memory_allocated StatsCounter

We don't use StatsCounters anymore for heap work, and this particular
counter causes issues for OffThreadSpace, as it can trigger a
non-thread-safe counter callback.

We could instead make this a thread-safe counter, but since it's unused
we may as well just remove it entirely.

Bug: chromium:1011762
Change-Id: I5af5ec5c408691ebfb762d87334ec4af54b1c0e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2126914
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67340}
parent 6eaa5193
...@@ -416,7 +416,6 @@ bool MemoryAllocator::CommitMemory(VirtualMemory* reservation) { ...@@ -416,7 +416,6 @@ bool MemoryAllocator::CommitMemory(VirtualMemory* reservation) {
return false; return false;
} }
UpdateAllocatedSpaceLimits(base, base + size); UpdateAllocatedSpaceLimits(base, base + size);
isolate_->counters()->memory_allocated()->Increment(static_cast<int>(size));
return true; return true;
} }
...@@ -426,7 +425,6 @@ bool MemoryAllocator::UncommitMemory(VirtualMemory* reservation) { ...@@ -426,7 +425,6 @@ bool MemoryAllocator::UncommitMemory(VirtualMemory* reservation) {
PageAllocator::kNoAccess)) { PageAllocator::kNoAccess)) {
return false; return false;
} }
isolate_->counters()->memory_allocated()->Decrement(static_cast<int>(size));
return true; return true;
} }
...@@ -981,11 +979,8 @@ MemoryChunk* MemoryAllocator::AllocateChunk(size_t reserve_area_size, ...@@ -981,11 +979,8 @@ MemoryChunk* MemoryAllocator::AllocateChunk(size_t reserve_area_size,
area_end = area_start + commit_area_size; area_end = area_start + commit_area_size;
} }
// Use chunk_size for statistics and callbacks because we assume that they // Use chunk_size for statistics because we assume that treat reserved but
// treat reserved but not-yet committed memory regions of chunks as allocated. // not-yet committed memory regions of chunks as allocated.
isolate_->counters()->memory_allocated()->Increment(
static_cast<int>(chunk_size));
LOG(isolate_, LOG(isolate_,
NewEvent("MemoryChunk", reinterpret_cast<void*>(base), chunk_size)); NewEvent("MemoryChunk", reinterpret_cast<void*>(base), chunk_size));
...@@ -1166,8 +1161,6 @@ void MemoryAllocator::PartialFreeMemory(MemoryChunk* chunk, Address start_free, ...@@ -1166,8 +1161,6 @@ void MemoryAllocator::PartialFreeMemory(MemoryChunk* chunk, Address start_free,
const size_t released_bytes = reservation->Release(start_free); const size_t released_bytes = reservation->Release(start_free);
DCHECK_GE(size_, released_bytes); DCHECK_GE(size_, released_bytes);
size_ -= released_bytes; size_ -= released_bytes;
isolate_->counters()->memory_allocated()->Decrement(
static_cast<int>(released_bytes));
} }
void MemoryAllocator::UnregisterMemory(MemoryChunk* chunk) { void MemoryAllocator::UnregisterMemory(MemoryChunk* chunk) {
...@@ -1177,7 +1170,6 @@ void MemoryAllocator::UnregisterMemory(MemoryChunk* chunk) { ...@@ -1177,7 +1170,6 @@ void MemoryAllocator::UnregisterMemory(MemoryChunk* chunk) {
reservation->IsReserved() ? reservation->size() : chunk->size(); reservation->IsReserved() ? reservation->size() : chunk->size();
DCHECK_GE(size_, static_cast<size_t>(size)); DCHECK_GE(size_, static_cast<size_t>(size));
size_ -= size; size_ -= size;
isolate_->counters()->memory_allocated()->Decrement(static_cast<int>(size));
if (chunk->executable() == EXECUTABLE) { if (chunk->executable() == EXECUTABLE) {
DCHECK_GE(size_executable_, size); DCHECK_GE(size_executable_, size);
size_executable_ -= size; size_executable_ -= size;
......
...@@ -237,8 +237,6 @@ namespace internal { ...@@ -237,8 +237,6 @@ namespace internal {
#define STATS_COUNTER_LIST_1(SC) \ #define STATS_COUNTER_LIST_1(SC) \
/* Global Handle Count*/ \ /* Global Handle Count*/ \
SC(global_handles, V8.GlobalHandles) \ SC(global_handles, V8.GlobalHandles) \
/* OS Memory allocated */ \
SC(memory_allocated, V8.OsMemoryAllocated) \
SC(maps_normalized, V8.MapsNormalized) \ SC(maps_normalized, V8.MapsNormalized) \
SC(maps_created, V8.MapsCreated) \ SC(maps_created, V8.MapsCreated) \
SC(elements_transitions, V8.ObjectElementsTransitions) \ SC(elements_transitions, V8.ObjectElementsTransitions) \
......
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