RFR: JDK-8297958: NMT: Display peak values [v4]
Stefan Johansson
sjohanss at openjdk.org
Tue Dec 6 15:59:33 UTC 2022
On Tue, 6 Dec 2022 15:47:43 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Thanks for the explanation. I guess the easy fix is just:
>>
>> const size_t count = (flag == mtChunk) ? 0 : c->count();
>
> Christ this is complex. :-(
>
> Both detail reporter and summary reporter share this printer code, but via MEMFLAG the print output is subtly changed. MEMFLAG=mtNone is taken as "print in summary report format" and != mtNone is "print in detail report format". This is all fixable but makes the already convoluted report not prettier.
>
> The other option would be to, in MallocMemorySnapshot::make_adjustment(), set the count to zero. But I don't dare this because afterwards the counter would assert if it were to be decreased further.
>
> See this mess? MallocMemorySnapshot is not really usable anymore as counter holder after the adjustment is made, because mtChunk counter got modified and now may assert for negative overflow. I believe MallocMemorySnapshot::make_adjustment() is only valid if you don't modify the counters anymore afterwards.
>
> I decided to leave it as it is. I don't think that anyone cares. As I wrote, I have plans to simplify this.
Fine by me =)
-------------
PR: https://git.openjdk.org/jdk/pull/11497
More information about the hotspot-runtime-dev
mailing list