On Fri, 30 Oct 2026 06:25:43 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 with a new target base due to a 
> merge or a rebase. The pull request now contains eight commits:
> 
>  - Merge branch 'master' into JDK-8381370
>  - Update testcase
>  - Fix
>  - fix
>  - Re-enable HeapDumpTestWithActiveProcess.java
>  - Merge branch 'master' into JDK-8381370
>  - Use getFieldHolder() rather than getKlass()
>  - 8381370: SA is not writing out flattened fields to the hprof file

The fix looks good. I've posted one nit and a question.

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
 line 1249:

> 1247:     private long generateIDForFlatObj() {
> 1248:         // to avoid conflicts with oop addresses skip aligned values.
> 1249:         // FlatObjectDumper::get_id() returns -1 (ULONG_MAX) if it 
> reaches max value, not rouded.

Nit: Typo at line 1249: `rouded` => `rounded`

test/hotspot/jtreg/serviceability/sa/LingeredAppWithValueObject.java line 112:

> 110: 
> 111:     @NullRestricted
> 112:     private static NonNullValueThreadObj nonNullValThreadObj;

Q: Is this `@NullRestricted` really needed?
     The type `NonNullValueThreadObj` extends `Thread` which is an identity 
class.
      Instead, is there a need for this annotation at line 91: `public final 
Rec  rec`?

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

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/33395#pullrequestreview-5745925159
PR Review Comment: https://git.openjdk.org/jdk/pull/33395#discussion_r4449857520
PR Review Comment: https://git.openjdk.org/jdk/pull/33395#discussion_r4449988833

Reply via email to