RFR: 8334026: Provide a diagnostic PrintMemoryMapAtExit switch on Linux [v2]
David Holmes
dholmes at openjdk.org
Tue Jun 18 09:27:18 UTC 2024
On Tue, 18 Jun 2024 08:32:23 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> src/hotspot/share/nmt/memMapPrinter.cpp line 207:
>>
>>> 205: static void print_thread_details_for_supposed_stack_address(const void* from, const void* to, outputStream* st) {
>>> 206:
>>> 207: ResourceMark rm;
>>
>> Why was this needed to be added here? Shouldn't callers have any needed ResourceMarks?
>
> It is needed because in this function we call Thread::name() which for java threads returns an RA-allocated string. This issue popped up now because we are called without a ResourceMark at VM exit. I have not investigated closer since I think the Resourcemark makes sense here: The function does not export any RA-allocated memory but may be called in a loop many times.
Okay. I was trying to find where the existing callers have their RM and it is not obvious.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19660#discussion_r1644137807
More information about the hotspot-runtime-dev
mailing list