RFR: 8255973: Add more logging to debug JDK-8255917 [v2]

Yumin Qi minqi at openjdk.java.net
Wed Nov 11 20:05:58 UTC 2020


On Wed, 11 Nov 2020 10:12:18 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix the region extra type name
>
> src/hotspot/share/services/virtualMemoryTracker.cpp line 293:
> 
>> 291: void ReservedMemoryRegion::set_flag(MEMFLAGS f) {
>> 292:   assert((flag() == mtNone || flag() == f),
>> 293:          "Overwrite memory type for region [" INTPTR_FORMAT "-" INTPTR_FORMAT "), %u->%u.",
> 
> Why the explicit change to INTPTR_FORMAT? (real question, I actually do not know the difference to PTR_FORMAT, since their definition seems to be identical)

They are defined as same, and p2i:
inline intptr_t p2i(const void * p) {
  return (intptr_t) p;
}
This way I think better use INTPTR_FORMAT, it is consistent with the type here.

> src/hotspot/share/runtime/os.cpp line 1672:
> 
>> 1670:     MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC);
>> 1671:   } else {
>> 1672:     log_info(metaspace)("Attempt to reserve memory at " INTPTR_FORMAT " for "
> 
> Why is this logged for "metaspace"? I would use "os"

Since we in this bug only concern about metaspace, if we specify -Xlog:os, it will output messaged we are not interested in from other places. I will wait for other inputs for this.

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

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


More information about the hotspot-runtime-dev mailing list