On Tue, 10 Nov 2026 17:01:20 GMT, Sergey Nazarkin <[email protected]> wrote:

>> I would like to finish the activity started by Man Cao [1] as we received 
>> several requests to support the dump over a network socket.   The original 
>> review stopped at the point where we needed to decide how to resolve the 
>> issue with the unmounted VT. Since none of the proposed solutions are 100% 
>> compatible with third-party HPROF tools, I opted for the simplest solution 
>> [2], which allows HPROF_HEAP_DUMP_SEGMENT to be mixed with HPROF_FRAME or 
>> HPROF_TRACE, breaking the linear sequence of top-level records. The related 
>> change is on line 
>> [2845](https://github.com/openjdk/jdk/pull/32733/changes#diff-bafe67cb93d9f50eb036e2aef63577ae58e78443343d6316251a6a283f398bcfR2845).
>> 
>> I’m still considering adding a guard option, such as `StrictSingleFileDump`, 
>> to explicitly enable the new behavior. Otherwise, the changes will 
>> automatically take effect on single-core instances. 
>> 
>> I have also refactored the original fix by moving all the segment writer 
>> code into a separate function. It should now look cleaner. 
>> 
>> Testing:
>> 1. tier1 on release build
>> 2. jtreg:test/hotspot/jtreg/serviceability on fast debug build
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>> 
>> [1] https://github.com/openjdk/jdk/pull/18160
>> [2] https://github.com/openjdk/jdk/pull/18160#issuecomment-1985383273
>
> Sergey Nazarkin has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Record any error on final stage

So we end the HPROF_HEAP_DUMP_SEGMENT and write a thread record.  We might get 
a very high number of HPROF_HEAP_DUMP_SEGMENT, with many vthreads?

I see 
test/hotspot/jtreg/serviceability/jvmti/vthread/HeapDump/VThreadInHeapDump.java 
passes, and with ActiveProcessorCount=1 if I add more Unmounted vthreads, I see 
that many additional HPROF_HEAP_DUMP_SEGMENTs are created in the dump.
This isn't necessarily a problem, just making it clear.
A parser should be able to cope - you mention not being 100% compatible, is 
there an example of something that fails?

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

PR Comment: https://git.openjdk.org/jdk/pull/32733#issuecomment-6956142675

Reply via email to