Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8258414: OldObjectSample events too expensive #2644

wants to merge 5 commits into from


Copy link

@flodav flodav commented Feb 19, 2021

The purpose of this change is to reduce the size of JFR recordings when the OldObjectSample event is enabled.


JFR recordings size blows up when the OldObjectSample is enabled. The memory allocation events are known to be very high traffic and will cause a lot of data, just the sheer number of events produced, and if stacktraces are added to this, the associated metadata can be huge as well. Sampled object are stored in a priority queue and their associated stack traces stored in JFRStackTraceRepository. When sample candidates are removed from the priority queue, their stacktraces remain in the repository, which will be later written at chunk rotation even if the sample has been removed.


This PR adds a JFRStackTraceRepository dedicated to store stack traces for the OldObjectSample event. At chunk rotation, every sample stack trace is looked up in this repository and is serialized. Other stack traces are simply removed.


On an AWS c5.metal instance (96 cores, 192 Gib), running SPECjvm2008 with default profile.jfc configuration with OldObjectSample event enabled gives

  • a recording size 2.78Mb with the PR fix
  • a recording size 20.73Mb with the PR fix


  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed



$ git fetch pull/2644/head:pull/2644
$ git checkout pull/2644

Copy link

bridgekeeper bot commented Feb 19, 2021

👋 Welcome back fdavid! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Feb 19, 2021
Copy link

openjdk bot commented Feb 19, 2021

@flodav The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot label Feb 19, 2021
Copy link
Contributor Author

flodav commented Feb 19, 2021

/label add hotspot-jfr

@openjdk openjdk bot added the hotspot-jfr label Feb 19, 2021
Copy link

openjdk bot commented Feb 19, 2021

The hotspot-jfr label was successfully added.

Copy link

mlbridge bot commented Feb 19, 2021


@flodav flodav closed this Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
hotspot hotspot-jfr rfr
1 participant