8357959: (bf) ByteBuffer.allocateDirect initialization can result in large TTSP spikes #118
+132
−17
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.
ByteBuffer.allocateDirect initialization can result in large TTSP spikes
This backport adapts the JDK 26 improvement for ByteBuffer.allocateDirect initialization to reduce TTSP spikes. Minor conflict in template resolved manually to preserve 2023 copyright.
Description
This is a backport of a change made in openjdk/jdk#25487
This is a performance change that prevents large safe point pauses during ByteBuffer.allocateDirect.
Related issues
Backport of openjdk/jdk#25487
Motivation and context
This change has been added to JDK26 for a few months, and back ported to JDK25. This is a large performance gain, which would be nice to have in the 21 jdk.
How has this been tested?
This has been tested via unit test, and a reproducer run shows the performance gains from ~1s to < 1ms
https://gist.github.com/rk-kmr/be4322b72a14ae04aeefc0260c01acf6
Platform information
None
Additional context