Semantics of ObjectAllocationSample.weight
Markus Gronlund
markus.gronlund at oracle.com
Fri May 28 08:48:28 UTC 2021
Hi Gunnar,
The weight attribute is intentionally kept a bit vague - we reserve the capability to fine tune the relations of samples in the future, perhaps when investigating other, more useful schemes.
I can confirm your understanding to be correct for the current implementation.
Thanks
Markus
-----Original Message-----
From: hotspot-jfr-dev <hotspot-jfr-dev-retn at openjdk.java.net> On Behalf Of Gunnar Morling
Sent: den 23 maj 2021 22:46
To: hotspot-jfr-dev at openjdk.java.net
Subject: Semantics of ObjectAllocationSample.weight
Hi,
I'm trying to understand the exact semantics of the "weight" attribute of the new JFR event type ObjectAllocationSample, which was added in Java 16.
My interpretation so far has been that this would be essentially the number of bytes allocated since the previous ObjectAllocationSample was emitted.
Is that correct? The event docs say:
"The relative weight of the sample. Aggregating the weights for a large number of samples, for a particular class, thread or stack trace, gives a statistically accurate representation of the allocation pressure"
Is this to say my understanding above is (only) correct when looking at a large number of OAS events? I believe it is, based on the observation that
sum(ObjectAllocationInNewTLAB.tlabSize) +
sum(jdk.ObjectAllocationOutsideTLAB.allocationSize) =
sum(jdk.ObjectAllocationSample.weight) for a large number of events. Any confirmation (or correction) would be appreciated. Also, does any more extensive description of the weight attribute exist somewhere?
Thanks a lot,
--Gunnar
More information about the hotspot-jfr-dev
mailing list