-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Memory Leak in S3's download_fileobj and upload_fileobj Methods #4132
Comments
I'm closing this issue as it is likely related to PyTorch rather than boto3. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
@Gabibing I encountered a similar issue. Using download_fileobj in the dataloader leads to memory leaks. Could you explain why you say this problem is related to PyTorch? Is it related to the versions of PyTorch and boto3? |
@Edwardyan1112 I was mistaken. I think it's a memory issue with boto3. So I reopened this issue. |
What specific problems did you encounter? |
@Edwardyan1112 When I use download_fileobj and upload_fileobj, MemoryUtilization.Percent indicators continue to increase. But it won't free memory. |
Thanks for reaching out, can you you please share debug logs (with sensitive info redacted) by adding |
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
Describe the bug
I have encountered a memory leak issue when using the S3 client's
download_fileobj
andupload_fileobj
methods with BytesIO in torchserve environment.Expected Behavior
I expected the memory usage to remain stable when using
download_fileobj
andupload_fileobj
methods for downloading and uploading files to and from an S3 bucket.Current Behavior
The memory usage increases constantly and is not released properly. Even after running gc.collect().
Reproduction Steps
Perhaps the issue occurs when continuously downloading/uploading different files.
I downloaded/uploaded different media files within torchserve(multi thread env).
Possible Solution
The memory leak can be resolved by replacing the code with the following implementation:
Additional Information/Context
additional attchment: pytorch config.properties
SDK version used
1.34.106
Environment details (OS name and version, etc.)
Ubuntu 20.04.6 LTS (Docker)
The text was updated successfully, but these errors were encountered: