-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
boto3 client with smart_open memory leak #3313
Comments
Thanks for reaching out. Can you please share your debug logs (with any sensitive info redacted) by adding |
After added log(boto3.set_stream_logger("boto3", level=logging.DEBUG)), it shows nothing new log. It's not smart_open bug. I have a class which will init new instance of boto3 client, and each call will raise the memory up. def print_memory_used():
import threading
import psutil
def monitor_memory():
pid = os.getpid()
process = psutil.Process(pid)
while True:
memory_info = process.memory_info()
memory_usage_mb = memory_info.rss / (1024**2) # MB
logger.info(
f"[Memory Monitor] Process ID: {pid}, Memory Usage: {memory_usage_mb:.2f} MB" # noqa
)
time.sleep(1)
memory_thread = threading.Thread(target=monitor_memory, daemon=True)
memory_thread.start() |
For us to investigate a memory issue with Boto3, please share a full Boto3 snippet without third party code and complete logs (with any sensitive info redacted). |
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
When use boto3 to read remote oss parquet file get memory leak.
Regression Issue
Expected Behavior
No memory leak
Current Behavior
As the method be called many times, the memory leak happend.
Reproduction Steps
Run this script many times
Possible Solution
I guess may related to smart_open object not be closed
Additional Information/Context
no
SDK version used
boto3==1.34.54 botocore==1.34.54
Environment details (OS name and version, etc.)
centos
The text was updated successfully, but these errors were encountered: