-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 chat completion create #1361
Comments
tracemalloc top 10 after performing few requests Snapshot comparison before invoke and after invoking once 1. Snapshot compare before invoking and after invoking for 8-10 times in loop Snapshot before invoking and after invoking for 10-15 times
The Process memory usage went from 80M to 326M after invoking this method for more then 200 times. |
Found this function at
|
Thanks, we'll look into this! |
Please upgrade to the latest version, you're quite far behind and we've fixed a bunch of memory leak issues since then. If this is still occurring then please re-open this issue. |
I upgraded openai version to 1.23.5 and still I can see some issues with the same function just it got moved to different place. |
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
After Making many streaming calls from a flask app the process memory is infinitely increasing and it is never getting reduced.
Even after performing close on response and client.
To Reproduce
Code snippets
OS
macOS,Linux
Python version
3.10.13
Library version
openai==1.3.4 , httpx==0.27.0 , pydantic==2.7.1, pydantic_core==2.18.2
The text was updated successfully, but these errors were encountered: