Merged
Conversation
alamb
reviewed
Mar 18, 2023
|
|
||
| assert_contains!( | ||
| err.to_string(), | ||
| "Resources exhausted: Failed to allocate additional" |
Dandandan
reviewed
Mar 19, 2023
| .map(|arr| arr.get_array_memory_size()) | ||
| .sum::<usize>() | ||
| + batch.num_rows().next_power_of_two() * 8 | ||
| + 24; |
Contributor
There was a problem hiding this comment.
Suggested change
| + 24; | |
| + sizeof::<Range>() | |
| + sizeof::<usize>(); |
Contributor
Author
There was a problem hiding this comment.
True, it may vary. I've fixed it in separate commit, thank you!
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.
Which issue does this PR close?
Closes #5220.
Rationale for this change
Control over memory allocation in
SortMergeJoinExecWhat changes are included in this PR?
SMJStream.reservation-- memory reservation to control buffered data size -- it may require significant amount of memory, for example, in case of multiple batches with the same join key valuespeak_memory_used-- during join execution, normally, bothtry_growandshrinkmethods are called -- on adding new buffered batches and on flushing them if join key has changed, respectively. In this case it seems reasonable to track only peak memory for each partition -- after that it's summed up across all partitions which is not really precise, but still valuable in terms of showing "worst case" (in fact peak memory used, probably, can be lower)SessionConfigand perform multiple checks on returned error (used to ensure that memory allocation failed in specific operator/stream)Are these changes tested?
Are there any user-facing changes?
SortMergeJoinExecshould now respect runtime memory limitations.