Memory Leak within load_ssl_context_verify
when using openai-python
#3272
Unanswered
vasudua
asked this question in
Potential Issue
Replies: 2 comments
-
seeing the same behaviour here... |
Beta Was this translation helpful? Give feedback.
0 replies
-
@vasudua did you figure things out? which version were you using? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
langchain
initialises anopenai-python
instance which in turn defines a default httpx client something like here when a custom http_client is not passed as an argument to the class initialization. And this httpx client defined continues to hold memory even after the parent object is destroyed.The place where the memory is being held up is

load_ssl_context_verify
, memray results follow.As shown in the above screenshot, it is holding ~88 MBs of memory. This memory keeps growing with each new instance of the above classes created and never gets released even when the parent objects of the above mentioned libs are destroyed.
Expected Behaviour
The memory should be released once the parent instances are destroyed.
Beta Was this translation helpful? Give feedback.
All reactions