-
Notifications
You must be signed in to change notification settings - Fork 140
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 with each SSL web request #380
Comments
@akrherz thanks for debugging this down to the root! The problem with recycling the context is that it contains all the information associated with the connection like, for example, the hostname that we are connecting to. So sharing them between hosts, at least, is not practically possible. However, with some re-plumbing within Twisted, we could store additional connection-specific data such as the hostname in In any case, this issue would probably reproduce just fine with just twisted's |
Thanks @glyph for chiming in and all your work on twisted over the years! I wonder if python/cpython#84904 is related? Will boggle this some more. I also have openssl 3.2.0 in play here on conda-forge, so lots of moving parts ;) |
You're welcome! Kind of you to say so.
Seems likely that the actual OpenSSL function is the one that's leaking, in which case it would affect both in the same way?
OK, let me know what you discover. |
I'm attempting to diagnose a memory leak with each
treq.get
call on a HTTPS website leaking small amounts of memory. This is my simple reproducer.running this with
memray
seems to indicate a SSL verify_paths leak inOpenSSL/SSL.py
set_result = _lib.SSL_CTX_set_default_verify_paths(self._context)
Is there a means to workaround this within
treq
? Perhaps create some context that can be reused throughout the lifetime of the running app?The text was updated successfully, but these errors were encountered: