[RESTEASY-3670] Prevent off-heap OOME with chunked entity file writes#4735
Merged
Conversation
Introduces chunked writing for entity output streams to prevent large DirectByteBuffer allocations when writing large POST request entities to temporary files. The default buffer size of 8KB prevents the NIO layer from allocating large thread-local buffers that can exhaust off-heap memory with small MaxDirectMemorySize settings. https://issues.redhat.com/browse/RESTEASY-3670 Signed-off-by: James R. Perkins <jperkins@ibm.com>
Sgitario
added a commit
to RedHatInsights/rhsm-subscriptions
that referenced
this pull request
Feb 16, 2026
Jira issue: SWATCH-4569 ## Description The issue is happening only when trying to upload larger files than 1 MB and causes the consumer to stop working (consuming more messages from the topic). This is caused by the changes in resteasy/resteasy#4735 which introduced ClientEntityOutputStream$PathHttpEntity which has a visibility class bug when trying to instantiate EntityInputStream. I reported the issue by RESTEASY-3691. These changes reproduce the issue and downgrade the resteasy version to 7.0.0. ## Testing Reproduced via unit tests. To reproduce the test manually, you would need to request a report larger than 1 MB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduces chunked writing for entity output streams to prevent large DirectByteBuffer allocations when writing large POST request entities to temporary files. The default buffer size of 8KB prevents the NIO layer from allocating large thread-local buffers that can exhaust off-heap memory with small MaxDirectMemorySize settings.
https://issues.redhat.com/browse/RESTEASY-3670