-
Notifications
You must be signed in to change notification settings - Fork 81
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
[BREAKING] Fix for OOM error when reading from S3 #5613
Merged
malhotrashivam
merged 11 commits into
deephaven:main
from
malhotrashivam:sm-s3-cache-fix
Jun 21, 2024
Merged
[BREAKING] Fix for OOM error when reading from S3 #5613
malhotrashivam
merged 11 commits into
deephaven:main
from
malhotrashivam:sm-s3-cache-fix
Jun 21, 2024
Conversation
This file contains 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
malhotrashivam
commented
Jun 13, 2024
extensions/s3/src/main/java/io/deephaven/extensions/s3/S3ChannelContext.java
Outdated
Show resolved
Hide resolved
devinrsmith
reviewed
Jun 14, 2024
extensions/s3/src/main/java/io/deephaven/extensions/s3/S3ChannelContext.java
Outdated
Show resolved
Hide resolved
extensions/s3/src/main/java/io/deephaven/extensions/s3/S3ChannelContext.java
Outdated
Show resolved
Hide resolved
extensions/s3/src/main/java/io/deephaven/extensions/s3/S3ChannelContext.java
Outdated
Show resolved
Hide resolved
devinrsmith
reviewed
Jun 14, 2024
extensions/s3/src/main/java/io/deephaven/extensions/s3/S3ChannelContext.java
Outdated
Show resolved
Hide resolved
chipkent
previously approved these changes
Jun 17, 2024
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.
Python LGTM
devinrsmith
previously approved these changes
Jun 20, 2024
rcaudy
reviewed
Jun 21, 2024
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.
We discussed some minor changes, but I'm ready to approve this.
rcaudy
approved these changes
Jun 21, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
breaking
bug
Something isn't working
NoDocumentationNeeded
parquet
Related to the Parquet integration
ReleaseNotesNeeded
Release notes are needed
s3
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.
Context:
In the current code, each
S3Context
object (which is created per thread and stores any data to be used by that thread for its operations) has a cache storing hard references to the last few fragments that this thread has fetched from S3. By default, the cache size is 256. This was added to prevent recently fetched fragments from getting freed by the garbage collector. The rest of the fragments are referenced via a soft-reference based cache, shared across all threads.Problem:
If a user configures really large fragment sizes, like 20 MB, then the local cache size grows very large and since these are all hard references, they cannot be freed by the garbage collector and can potentially lead to an Out of Memory error.
PR description:
As part of this PR, we have removed the thread local cache of hard references, and all the caching will be done via a soft reference based cache shared across all threads.
Breaking:
We have removed the cache related s3 specific instructions from the API, namely
S3Instructions#maxCacheSize()
from java ands3.S3Instructions.max_cache_size
from python wrapper.