RFR: JDK-8269092: Add OldObjectSampleEvent.allocationSize field

Ludovic Henry luhenry at openjdk.java.net
Thu Jun 24 09:18:29 UTC 2021


On Tue, 22 Jun 2021 08:32:56 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

> The data is already available in ObjectSample.allocated and getting this data
> in another way is complicated (via Instrumentation for example). Having the
> size of the objects also allows to augment the memory leak analysis based on
> the object size impact on top of based on the object count impact.

Let me just add a quick example of how we plan to use it.

At Datadog, we have for other languages Heap Live Objects and Heap Live Size profilers. These work for Python and Go in a very similar manner to the OldObjectSample in JFR: it takes a sample of objects, and track their lifetime.

Here is an example of what it looks like in practice on a sample profile:

![image](https://user-images.githubusercontent.com/660779/123236836-6c9cac00-d4dd-11eb-9e29-3813c0c138ab.png)
![image](https://user-images.githubusercontent.com/660779/123236709-5393fb00-d4dd-11eb-9866-9afa93543c25.png)

JFR generally tracks more useful data, like the reference chains. Unfortunately, we are still blocked for the Heap Live Size profiler in Java because we need to match an OldObjectSample to the size it occupies on the heap, and we have no way today to map precisely the object type to the object allocated size. This is what this PR is attempting to fix.

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

PR: https://git.openjdk.java.net/jdk/pull/4549


More information about the hotspot-jfr-dev mailing list