-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 when using with_options()
to configure options per request
#865
Labels
bug
Something isn't working
Comments
Thanks for reporting and sharing your debugging steps, we'll look into this soon! |
stainless-bot
added a commit
to lithic-com/lithic-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to lithic-com/lithic-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to anthropics/anthropic-sdk-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to Finch-API/finch-api-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to anthropics/anthropic-sdk-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to Finch-API/finch-api-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to anthropics/anthropic-bedrock-python
that referenced
this issue
Dec 8, 2023
This was referenced Dec 8, 2023
Merged
stainless-bot
added a commit
to orbcorp/orb-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to lithic-com/lithic-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to anthropics/anthropic-bedrock-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to Modern-Treasury/modern-treasury-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to orbcorp/orb-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to Modern-Treasury/modern-treasury-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to orbcorp/orb-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to Increase/increase-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to Increase/increase-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
to Increase/increase-python
that referenced
this issue
Dec 8, 2023
stainless-bot
added a commit
that referenced
this issue
Dec 9, 2023
stainless-bot
added a commit
to anthropics/anthropic-bedrock-python
that referenced
this issue
Dec 13, 2023
stainless-bot
added a commit
to anthropics/anthropic-sdk-python
that referenced
this issue
Dec 13, 2023
stainless-bot
added a commit
to Finch-API/finch-api-python
that referenced
this issue
Dec 18, 2023
stainless-bot
added a commit
to Modern-Treasury/modern-treasury-python
that referenced
this issue
Jan 2, 2024
luckdev2350
added a commit
to luckdev2350/openai_python
that referenced
this issue
May 9, 2024
risingstar0225
added a commit
to risingstar0225/openai_py
that referenced
this issue
Jul 26, 2024
megamanics
pushed a commit
to devops-testbed/openai-python
that referenced
this issue
Aug 14, 2024
Watcher919
added a commit
to Watcher919/Python-openAI
that referenced
this issue
Sep 4, 2024
39 tasks
cgayapr
pushed a commit
to cgayapr/openai-python
that referenced
this issue
Dec 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
Using
with_options()
to configure options per request introduces a memory leak.How to determine it's a memory leak?
The following code calls the completion API 10 times. On each iteration, it takes a snapshot of traces of memory blocks using
tracemalloc
, compares it to the snapshot of the previous iteration, and prints the top 2 differences. The memory required by theopenai
library increases on every iteration. In particular, the following lines have the most increases (using sync client):Potential cause
Looking at the library code, when using
with_options()
, a new client is created on every request (sync client and async client).To Reproduce
Use
with_options()
and make multiple API calls.Code snippets
No response
OS
macOS
Python version
Python v3.11.5
Library version
openai v1.3.3
The text was updated successfully, but these errors were encountered: