diff options
author | 2024-07-17 15:20:40 +1000 | |
---|---|---|
committer | 2024-07-17 22:23:00 +0000 | |
commit | c295d71a564b86bec353d106c63912da46a91bb5 (patch) | |
tree | 9e9d14a51fc1a9fd64827fc4f1af7db5452cfc47 /build/apex/art_apex_test.py | |
parent | 59501af329dc5f6f73ee293422d0226d1ffb362a (diff) |
hprof: output header size of arrays
Empty arrays, e.g. `new long[0]` take up room on the heap; they have a
class pointer, synchronization monitor, and a length.
But we were saying their header size is 0, resulting in ahat and Android
Studio Memory Profiler incorrectly listing the memory byte size of empty
arrays as 0.
This was set to output 0, which dates back to the initial check-in of
hprof code, presumably as a placeholder.
The header of arrays is padded in ComputeArraySize, up to the alignment
of the component, even if array is of size 0:
https://cs.android.com/android/platform/superproject/main/+/main:art/runtime/mirror/array-alloc-inl.h;l=40-42;drc=d194518ee3f46839ea545e7178d3f3d1f1ef1e5f
Here's an example of another place where we get the size of the array:
https://cs.android.com/android/platform/superproject/main/+/main:art/compiler/debug/elf_debug_info_writer.h;l=309-310;drc=57365e2258cfe0dfb2d26c9cf056075d5a26c573
This proposal is the same as both the above prior art.
Fix: 353415293
Test: no, I haven't.
Change-Id: I8d8422921aae207b418e377b589e25287748f0cf
Diffstat (limited to 'build/apex/art_apex_test.py')
0 files changed, 0 insertions, 0 deletions