Commit 6ee0e4c4 authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

cppgc: Fix DCHECK in statistics collection

Resident set size may be smaller than the recorded size in
StatsCollector due to discarded memory.

Change-Id: I7e052fc4412afc64dc1ed5be6ed7dc9271e6f9d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855204
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82709}
parent d75a0eed
......@@ -98,7 +98,7 @@ struct HeapStatistics final {
/** Overall committed amount of memory for the heap. */
size_t committed_size_bytes = 0;
/** Resident amount of memory help by the heap. */
/** Resident amount of memory held by the heap. */
size_t resident_size_bytes = 0;
/** Amount of memory actually used on the heap. */
size_t used_size_bytes = 0;
......
......@@ -109,7 +109,9 @@ HeapStatistics HeapStatisticsCollector::CollectDetailedStatistics(
}
}
DCHECK_EQ(heap->stats_collector()->allocated_memory_size(),
// Resident set size may be smaller than the than the recorded size in
// `StatsCollector` due to discarded memory that is tracked on page level.
DCHECK_GE(heap->stats_collector()->allocated_memory_size(),
stats.resident_size_bytes);
return stats;
}
......
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