RFR: JDK-8281460: Let ObjectMonitor have its own NMT category
Daniel D.Daugherty
dcubed at openjdk.java.net
Wed Feb 9 17:33:12 UTC 2022
On Tue, 8 Feb 2022 08:10:05 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> It would be useful to distinguish ObjectMonitor allocations in NMT, as a simple way to both to see the needed footprint as well as the number of allocated monitors.
>
> Note, this needs [JDK-8281450](https://bugs.openjdk.java.net/browse/JDK-8281450) as a prerequisite.
Actually `ObjectMonitor` is `mtInternal` in JDK-8253064 intentionally. Here's the original
code that allocated blocks of ObjectMonitors:
void* real_malloc_addr = NEW_C_HEAP_ARRAY(char, aligned_size, mtInternal);
temp = (PaddedObjectMonitor*)align_up(real_malloc_addr, OM_CACHE_LINE_SIZE);
(void)memset((void *) temp, 0, neededsize);
so the change in allocation implementation in JDK-8253064 is consistent (NMT tag wise)
with what was there before.
That said, I have no complaints about using a specific NMT tag. However, I would
have used "ObjectMonitors" instead of "Monitors" to avoid confusion with VM internal
Monitors. One good reason for this change is that NMT is used for analyzing unexpected
memory usages and since we changed the allocation implementation and some of the
policy in JDK-8253064 it would be good to "highlight" that in NMT as we continue to
shake out what we did in JDK-8253064.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7378
More information about the hotspot-runtime-dev
mailing list