[lworld] RFR: 8341771: [lworld] Heap dump recognizing new flat fields formats [v2]

Frederic Parain fparain at openjdk.org
Thu Nov 6 20:12:30 UTC 2025


On Thu, 6 Nov 2025 19:30:55 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

>> src/hotspot/share/services/heapDumper.cpp line 1445:
>> 
>>> 1443:   int type_size;
>>> 1444:   if (type == T_OBJECT || type == T_FLAT_ELEMENT) {
>>> 1445:     type_size = sizeof(address);
>> 
>> Array elements size is not always sizeof(address) for flat arrays (could be smaller or bigger).
>> The real size of the array elements can be retrieved using the element_byte_size() method in FlatArrayKlass.
>
> This is element size in the array dump, not in memory.
> Elements of flat arrays are dumped as heap-allocated objects, i.e. each element in the dump is represented by object ID, ObjectID size is sizeof(address).

OK, thank you for the clarification.

-------------

PR Review Comment: https://git.openjdk.org/valhalla/pull/1700#discussion_r2500660346


More information about the valhalla-dev mailing list