-
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
Garbage collection using gc.collect()
is not showing any effect
#3541
Comments
gc.collect()
is not showing any effect
Hi @sudouser777 thanks for reaching out. I hope you don't mind that I reworded your issue title a bit so as not to confuse the boto3 resource interface with general resources. There are a few other issues that mentioned attempts to use
Issues involving memory usage can be difficult to fully replicate between different environments. If you could provide your debug logs (with any sensitive info redacted) by adding |
@tim-finnigan added the logs |
Thanks for following up. Are you able to replicate this issue in different environments? And is it consistent across services and commands? Also please let us know if you had a chance to read through those related issues to see if there is any overlap with what you're running into. |
@tim-finnigan I'm able to reproduce the issue in all the below-mentioned cases
I have checked the issues you mentioned before creating the bug, But those all are mostly happening in multithreading |
I was doing some research and think I found your corresponding Stack Overflow post: https://stackoverflow.com/questions/74911597/garbage-collection-is-not-happening-properly-when-using-boto3 For reference I'll also link the |
@tim-finnigan no, I have read multiple articles about |
@tim-finnigan I have tested with this sample code. I am testing the memory usage here in 2 cases one where I'm not using
Output for
Output for
|
Hi @sudouser777 do you have any updates as far as what you've tried? Have you used any tools to measure the memory usage? I'm still not sure why |
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. |
Issue is still happening, I haven't found any solution so far |
Describe the bug
When we invoke boto3 client methods multiple times/ running in some kind of loop for n times, memory is getting accumulated with each iteration. Even if we call the
gc.collect()
it also not showing any effectExpected Behavior
Current Behavior
If we are running some boto3 code in loop for n times, memory is accumulating with each iteration
gc.collect()
not releasing unused memory. At the end of the programgc.collect()
returning 0 unreachable objectsbut this also doesn't show any change in memory usage.
Reproduction Steps
Attached sample code we can reproduce the issue by running the above code
Possible Solution
No response
Additional Information/Context
Logs: log.txt
SDK version used
1.26.37
Environment details (OS name and version, etc.)
Linux 5.15.84-1-MANJARO
The text was updated successfully, but these errors were encountered: