8258414: OldObjectSample events too expensive #2644
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this change is to reduce the size of JFR recordings when the OldObjectSample event is enabled.
Problem
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 inJFRStackTraceRepository
. 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.Implementation
This PR adds a
JFRStackTraceRepository
dedicated to store stack traces for theOldObjectSample
event. At chunk rotation, every sample stack trace is looked up in this repository and is serialized. Other stack traces are simply removed.Benchmarks
On an AWS c5.metal instance (96 cores, 192 Gib), running SPECjvm2008 with default profile.jfc configuration with OldObjectSample event enabled gives
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2644/head:pull/2644
$ git checkout pull/2644