Commit 9021e274 authored by Benoit Lize's avatar Benoit Lize Committed by Chromium LUCI CQ

[PartitionAlloc] Break down aligned partition footprint in memory-infra.

With PartitionAlloc-Everywhere, there are two partitions: one for
malloc(), and one for posix_memalign() (and equivalent). mallinfo()
reports data for both partitions together.

However there is a suspicion that having two separate partitions may
increase GPU process memory footprint. To break these down, separate the
aligned partition data from the regular one.

On Linux, this shows that browser and renderer processes don't have a
lot of aligned memory, but the GPU process does. For instance, with a
single CNN.com tab open, there is a ~50/50 split between the regular and
aligned partitions, and the aligned partition uses a lot of address
space as well, respectively 128MiB allocated, and 179MiB mapped.

Note: this may change sizes for some malloc() metrics with detailed
dumps.

Bug: 998048
Change-Id: I29dd7a93515ef25736ea830ddf663e85b9e122a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617848
Commit-Queue: Benoit L <lizeb@chromium.org>
Reviewed-by: default avatarssid <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841981}
parent e7d3a28a
......@@ -81,6 +81,28 @@ void ReportPartitionAllocStats(ProcessMemoryDump* pmd, bool detailed) {
ReportPartitionAllocThreadCacheStats(main_thread_cache_dump,
main_thread_stats);
}
// Not reported in UMA, detailed dumps only.
if (detailed) {
SimplePartitionStatsDumper aligned_allocator_dumper;
internal::PartitionAllocMalloc::AlignedAllocator()->DumpStats(
"malloc/aligned", !detailed /* is_light_dump */,
&aligned_allocator_dumper);
// These should be included in the overall figure, so using a child dump.
auto* aligned_allocator_dump = pmd->CreateAllocatorDump("malloc/aligned");
// See
// //base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc
// for the sum of the aligned and regular partitions.
aligned_allocator_dump->AddScalar(
"virtual_size", MemoryAllocatorDump::kUnitsBytes,
aligned_allocator_dumper.stats().total_mmapped_bytes);
aligned_allocator_dump->AddScalar(
MemoryAllocatorDump::kNameSize, MemoryAllocatorDump::kUnitsBytes,
aligned_allocator_dumper.stats().total_resident_bytes);
aligned_allocator_dump->AddScalar(
"allocated_size", MemoryAllocatorDump::kUnitsBytes,
aligned_allocator_dumper.stats().total_active_bytes);
}
}
#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
......
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