RFR: 8255973: Add more logging to debug JDK-8255917 [v2]
David Holmes
dholmes at openjdk.java.net
Thu Nov 12 02:27:59 UTC 2020
On Wed, 11 Nov 2020 20:03:32 GMT, Yumin Qi <minqi at openjdk.org> wrote:
>> 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.
This is 'os' code so the logging should be in the os tag space, though it could be os+metaspace. I also think info is inappropriate and this should be debug or trace level. Alternatively put the logging in a caller that is more obviously only for metaspace.
>> 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.
I agree - semantically we use INTPTR_FORMAT when passing a p2i(x). Though it does beg the question as to why we are applying p2i in this case?
-------------
PR: https://git.openjdk.java.net/jdk/pull/1150
More information about the hotspot-runtime-dev
mailing list