RFR: 8280289: Enhance debug pp() command with NMT info [v3]

Zhengyu Gu zgu at openjdk.java.net
Sat Jan 22 15:00:09 UTC 2022


On Sat, 22 Jan 2022 08:46:41 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Missing include file
>
> src/hotspot/share/services/virtualMemoryTracker.cpp line 693:
> 
>> 691: };
>> 692: 
>> 693: const ReservedMemoryRegion* VirtualMemoryTracker::find_region(void* p) {
> 
> Curious, is this thread-safe? Do we care if not?

It is not thread-safe. But the command is running inside debuger, I don't see there is concurrent case.

> src/hotspot/share/utilities/debug.cpp line 496:
> 
>> 494:           p2i(p), p2i(rgn->base()), p2i(rgn->base() + rgn->size()), rgn->flag_name());
>> 495:         if (tracking_level == NMT_detail) {
>> 496:           rgn->call_stack()->print_on(tty);
> 
> Idea for later cleanup. In detail mode, malloc headers have no call stack (NULL) whereas regions have an empty stack (NativeCallStack::_empty_stack) ? If yes, may be nice to unify this behavior. 
> 
> Maybe also remove checks like this here, for MemTracker::tracking_level=detail, in favor of checking if rgn->call_stack() is NULL. That would feel more consistent and allow us (if we ever wanted) to have regions with and without stack.

Yes. I noticed the inconsistent of call stack handling and yes, I would like to defer to other CR.

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

PR: https://git.openjdk.java.net/jdk/pull/7160


More information about the hotspot-dev mailing list