On Thu, 22 Oct 2026 03:01:34 GMT, Yasumasa Suenaga <[email protected]> wrote:

>> Valhalla introduced flattened value object, however SA cannot dump it into 
>> heapdump e.g. `jhsdb jmap --binaryheap`.
>> Actually HeapHprofBinWriter.java has following lines. Hence the user cannot 
>> check flattened object from heapdump generated by SA.
>> 
>> 
>>         case JVM_SIGNATURE_CLASS:
>>         case JVM_SIGNATURE_ARRAY: {
>>             if (field.isFlat()) {
>>               // FIXME - we don't handle flattened fields yet. Just treat 
>> them
>>               // as a null reference. See JDK-8381370.
>>               writeObjectID(null);
>> 
>> 
>> This PR addressed it.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Yasumasa Suenaga has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   fix

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java
 line 115:

> 113:                                     throw new RuntimeException(exp);
> 114:                                 }
> 115:                             }

Using a finally block for this seems kind of odd. If there is an exception, we 
probably don't want to be processing flatObjects. Also it seems odd to process 
flatObjects but not call writeHeapRecordEpilogue(), even though it doesn't do 
anything.  I think the earlier "return false" should probably be replaced with 
a "break", and also add a flag (something like "isThread") that can be used to 
decide if the writeInstance() call should be skipped.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33395#discussion_r4344384578

Reply via email to