RFR: 8346123: [REDO] NMT should not use ThreadCritical [v3]
Robert Toyonaga
duke at openjdk.org
Thu Dec 19 21:04:53 UTC 2024
On Thu, 19 Dec 2024 02:19:29 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> This change was decided on in the original PR after it was discovered that calling [os::print_memory_mappings](https://github.com/openjdk/jdk/blob/jdk-25%2B2/src/hotspot/os/windows/os_windows.cpp#L3623) from the windows implementation of `os::pd_release_memory` causes a rank conflict between `tty_lock` and `NmtVirtualMemory_lock`. This is getting called from `os::release_memory` [after we've already acquired the lock for NMT](https://github.com/openjdk/jdk/blob/jdk-25%2B2/src/hotspot/share/runtime/os.cpp#L2202-L2203).
>>
>> Original discussion here https://github.com/openjdk/jdk/pull/20852#issuecomment-2350882050.
>
> Okay ... still not sure this shouldn't be dynamically determining whether stdout or stderr is the right target.
Ok I see. I've changed it now to use `defaultStream::output_stream()` which should choose either stderr or stdout based on the VM flags.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22745#discussion_r1893138320
More information about the serviceability-dev
mailing list