grafana / jfr-parser

Java Flight Recorder parser library written in Go.
Apache License 2.0
43 stars 16 forks source link

Add support for ObjectAllocationSample event #42

Closed sivachandran closed 2 months ago

sivachandran commented 2 months ago

The PR adds support for ObjectAllocationSample JFR event.

The event was introduced in JDK 16. Unlike the events ObjectAllocationInNewTLAB and ObjectAllocationOutsideTLAB the ObjectAllocationSample is a sampling event and adds less overhead compared with the TLAB based events. But the allocation metric provided by ObjectAllocationSample event is less accurate due to its sampling nature.

The TLAB based events are disabled by default in JDK 16+ and only ObjectAllocationSample event is enabled by default. Please refer the following links for more details

https://bugs.openjdk.org/browse/JDK-8262902 https://bugs.openjdk.org/browse/JDK-8257602

NOTE: The jfr to pprof formatter has been modified to include the profile index in the filename as now there can be three memory profiles. We don't want them each overwrite each other (it was overwriting even in TLAB based events).

sivachandran commented 2 months ago

@korniltsev can you tag the changes?

korniltsev commented 2 months ago

Is this the last PR from you or more coming ? :)

sivachandran commented 2 months ago

I don't know :smile:

I'm investigating empty profiles from OpenJDK 21 JFR. But it is not just jfr-parser, even async-profiler produces empty pprof. But it looks like I need to take it up with the profiler author which would take time. So I don't foresee any PRs tomorrow(hopefully).

It would help me if you can tag as I don't have to use my fork and git mod replace. But it is fine if you want to wait.

korniltsev commented 2 months ago

I will tag in an hour

On Mon, 9 Sep 2024 at 2:47 PM, Sivachandran Paramasivam < @.***> wrote:

I don't know 😄

I'm investigating empty profiles from OpenJDK 21 JFR. But it is not just jfr-parser, even async-profiler produces empty pprof. But it looks like I need to take it up with the profiler author which would take time. So I don't foresee any PRs tomorrow(hopefully).

It would help me if you can tag as I don't have to use my fork and git mod replace. But it is fine if you want to wait.

— Reply to this email directly, view it on GitHub https://github.com/grafana/jfr-parser/pull/42#issuecomment-2338033540, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQ77NB6UVV6MKNZI6ZVNTZVWKGLAVCNFSM6AAAAABN35O7UKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZYGAZTGNJUGA . You are receiving this because you were mentioned.Message ID: @.***>

korniltsev commented 2 months ago

I will tag in an hour