Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Include active spiller when computing peak shuffle memory #196

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ private long getMemoryUsage() {
for (SpillSorter sorter : spillingSorters) {
totalPageSize += sorter.getMemoryUsage();
}
totalPageSize += activeSpillSorter.getMemoryUsage();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[doubt] any ideas for testing it ? whats the max variance this can cause in worst case ? activeSpillSorter is just full ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to test this in a unit test, but this is clearly something missing. In the non-async path, only activeSpillSorter is used for sorting and spilling, and currently getMemoryUsage doesn't take account of it.

return totalPageSize;
}

Expand All @@ -274,6 +275,7 @@ public long getPeakMemoryUsedBytes() {
}

private long freeMemory() {
updatePeakMemoryUsed();
long memoryFreed = 0;
if (isAsync) {
for (SpillSorter sorter : spillingSorters) {
Expand Down
Loading