-
Notifications
You must be signed in to change notification settings - Fork 652
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
service/s3/s3manager: Reduce downloader memory allocations & GC runs #482
Labels
Comments
vvelikodny
changed the title
service/s3/s3manager: Fix downloader memory allocation/GC issue
service/s3/s3manager: downloader memory allocation/GC issue
Feb 2, 2020
vvelikodny
changed the title
service/s3/s3manager: downloader memory allocation/GC issue
service/s3/s3manager: Reduce memory allocations & GC runs
Feb 2, 2020
vvelikodny
changed the title
service/s3/s3manager: Reduce memory allocations & GC runs
service/s3/s3manager: Reduce downloader memory allocations & GC runs
Feb 2, 2020
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
github-actions
bot
added
closing-soon
This issue will automatically close in 4 days unless further comments are made.
closed-for-staleness
and removed
closing-soon
This issue will automatically close in 4 days unless further comments are made.
labels
Feb 3, 2021
issue still presented in new SDK #483 (comment) |
jasdel
pushed a commit
that referenced
this issue
Mar 18, 2021
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of AWS SDK for Go?
v0.19.0
Version of Go (
go version
)?go version go1.13.4 darwin/amd64
What issue did you see?
in case the user of the library doesn't create a buffer with a particular size and pass it to the S3
downloader
, it downloads file part-by-part from 1st byte up to file length. ThusWriteAtBuffer
increase buffer size based on the current max downloaded part, but we know file size at the start after this code:https://github.com/aws/aws-sdk-go-v2/blob/master/service/s3/s3manager/download.go#L314
so I propose download file backward => from the end of the file, so we will allocate the right memory at the start as the last part of the file will be downloaded at the beginning of the process and then buffer never be reallocated. It gives good optimization and GC doesn't work during the whole process, at the beginning only.
Before pull request:
After pull request:
trace_2_bad_gc.txt
trace_2_good_gc.txt
Steps to reproduce
My sample code:
here I investigated also memory issues with huge allocations on start, but think it should be in the next issue/pull request.
The text was updated successfully, but these errors were encountered: