On Wed, 8 Sep 2021 13:39:08 GMT, Ralf Schmelter <rschmel...@openjdk.org> wrote:
>> Lin Zang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix build error > > src/hotspot/share/services/attachListener.cpp line 255: > >> 253: HeapDumper dumper(live_objects_only /* request GC */); >> 254: dumper.dump(path, out, (int)level, (uint)parallel_thread_num); >> 255: } > > The call signature for dump has changed, since it now takes an overwrite bool > value after the compression level. This means that actually the number of > parallel threads is not set but remains at the default value of 1. So the > parallel case is never executed currently. The parallel threads number is set to `MAX2<uint>(1, (uint)os::initial_active_processor_count() * 3 / 8);` after the change. > src/hotspot/share/services/heapDumperCompression.cpp line 386: > >> 384: size_t tmp_max = 0; >> 385: >> 386: MonitorLocker ml(_lock, Mutex::_no_safepoint_check_flag); > > This is not thread safe if flush_external_buffer() or get_new_buffer() are > called concurrently. But it seems to be Ok since flush_external_buffer() is > only called with the _lock var of the parallel writer locked, so there is no > contention. Is this correct? Yes, it is correct. ------------- PR: https://git.openjdk.java.net/jdk/pull/2261