On Tue, 12 Dec 2023 00:19:15 GMT, Alex Menkov <amen...@openjdk.org> wrote:

>> src/hotspot/share/services/heapDumper.cpp line 1984:
>> 
>>> 1982: // user space.
>>> 1983: void DumpMerger::merge_file(char* path) {
>>> 1984:   assert(!SafepointSynchronize::is_at_safepoint(), "merging happens 
>>> outside safepoint");
>> 
>> This might fix the failure but why is this restriction in place to begin 
>> with? This seems like a very expensive operation to be performing by the 
>> VMThread during a safepoint!
>
> Main idea of segmented heap dump feature (JDK-8306441, #13667) is to divide 
> heap dump process to 2 phases - dump to segment files (this phase is executed 
> at safepoint) and merge of the segment files (this one is supposed to be 
> executed outside of safepoint, so VM is not blocked in this phase). And this 
> asserts were added to ensure it works as desired.
> I think merge stage can be performed on the current thread without 
> VMOperation, but I don't know all possible consequences of the change.

Prior to the virtual thread changes what thread is performing the merge? After 
these changes what thread would do it if not included in the VM operation?

The assert is correct - we should not do the merge at the safepoint (or even in 
the VMThread).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17040#discussion_r1423523614

Reply via email to