-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Changes to reduce memory pinned while iterating through state backed iterable #32961
base: master
Are you sure you want to change the base?
Conversation
…iterable: - remove reference to completed encoded input page from decoder once we have read it. - re-read from cache after loading the next page to give eviction a chance to remove blocks
Run Java PreCommit |
Run Java_IOs_Direct PreCommit |
R: @robertwb |
FYI @priyansndesai |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
Run Java PreCommit |
Run Java_GCP_IO_Direct PreCommit |
@@ -202,6 +202,12 @@ public WeightedList<T> decodeFromChunkBoundaryToChunkBoundary() { | |||
T next = next(); | |||
rvals.add(next); | |||
} | |||
// We don't support seeking backwards so release the memory of the last |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this only happen on the last block? (Otherwise, wouldn't we typically break because previousStream != inbound.currentStream?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this happens whenever decoding an element ends up completing consuming the current bytestring. Since we are communicating entire elements over the fnapi that occurs for every block.
(In fact it seems like a bug otherwise since we are looping over decodeFromChunkBoundaryToChunkBoundary above this and this method discards the currentStream on line 194; if there were bytes in it they would be lost.)
previousStream would only not equal currentStream in the case where the decoder needed to move to the next bytestring to finish parsing the next element. If that did happen, we would no longer be holding onto currentStream and it would be eligible for collection anyway.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.