RFR: 8334026: Provide a diagnostic PrintMemoryMapAtExit switch on Linux

Thomas Stuefe stuefe at openjdk.org
Tue Jun 18 08:35:12 UTC 2024


On Fri, 14 Jun 2024 04:45:01 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> To investigate footprint problems of processes with a short lifespan (e.g. startup footprint problems), we found it very useful to be able to get an annotated memory map at exit - the same map printed by jcmd System.map.
>
> 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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19660#discussion_r1644063717


More information about the hotspot-runtime-dev mailing list