[#2716] feat(spark): Introduce option of max segments decompression to control memory usage#2735
Merged
zuston merged 3 commits intoapache:masterfrom Mar 2, 2026
Merged
Conversation
…sion to control memory usage
3 tasks
wForget
reviewed
Feb 28, 2026
| RSS_READ_OVERLAPPING_DECOMPRESSION_MAX_CONCURRENT_SEGMENTS = | ||
| ConfigOptions.key("rss.client.read.overlappingDecompressionMaxConcurrentSegments") | ||
| .intType() | ||
| .defaultValue(-1) |
Member
There was a problem hiding this comment.
Should we set the default value to 1? That would make memory usage similar to when overlapping disabled.
Member
Author
There was a problem hiding this comment.
I think we could adopt a more aggressive value, which should result in better performance.
wForget
approved these changes
Feb 28, 2026
roryqi
reviewed
Feb 28, 2026
| // block | ||
| if (block != null) { | ||
| nowMemoryUsed.addAndGet(-block.getUncompressLength()); | ||
| segmentPermits.ifPresent(x -> x.release()); |
Contributor
There was a problem hiding this comment.
When block is null, we don't release. Will it cause dead lock? Should we use try finally to gurantee the release of the lock.
Member
Author
There was a problem hiding this comment.
We have ensured the block is not always null here.
Member
Author
Contributor
Member
Author
wForget
approved these changes
Mar 2, 2026
roryqi
approved these changes
Mar 2, 2026
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.
What changes were proposed in this pull request?
Introduce option of max segments decompression to control memory usage
Why are the changes needed?
To address issue #2716, this PR introduces an option to set the maximum number of concurrent decompression segments, allowing better control over overall memory usage. Setting this value to 1 restricts decompression to a single segment at a time.
Does this PR introduce any user-facing change?
Yes
How was this patch tested?
Unit test