RFR: 8157023: Integrate NMT with JFR

Erik Gahlin egahlin at openjdk.org
Fri Dec 2 10:47:21 UTC 2022


On Fri, 2 Dec 2022 08:17:17 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> src/hotspot/share/jfr/metadata/metadata.xml line 711:
>> 
>>> 709:   <Event name="NativeMemoryUsagePart" category="Java Virtual Machine, Memory" label="Component Native Memory Usage" description="Native memory usage for a component" stackTrace="false" thread="false"
>>> 710:     startTime="false" period="everyChunk">
>>> 711:     <Field type="string" name="type" label="Memory Type" description="Component allocating the native memory" />
>> 
>> Is there a better way than to re-transmit the category name with every event?
>
> There is a way to create special JFR types and instead just send an ID. This might make sense to save some extra memory. @egahlin, is there any drawback with creating custom type? Apart from the parsing needing an extra step.

Not really. See for https://github.com/openjdk/jdk/blob/master/src/hotspot/share/jfr/metadata/jfrSerializer.hpp for how to serialize constants. Since the number of events are few and they are opt-in using a command line flag, I don't think it will make much of a difference from a performance perspective, but I don't think it will hurt either.

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

PR: https://git.openjdk.org/jdk/pull/11449


More information about the hotspot-dev mailing list