-
-
Notifications
You must be signed in to change notification settings - Fork 90
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 BuiltinSSLAdapter #647
Comments
Hello. Is this reproducible with a distro-default Python in any official/public container image? I'd rather not have a repro dependent on compiling CPython from scratch. Is there a console log output that you can share? |
Hello, you can reproduce this issue on Debian bookworm (12.5)
I also managed to reproduce the same issue with cheroot version 10.0.0 in a virtual environment on the same system. No log or console log, as everything works fine, but this memory leak If needed, you can generate your certificate with following command : |
After further investigation the leak appeared in version 8.3.0 We suspect BuiltinSSLAdapter.get_environ(self, sock) method to be the root cause. I hope this may help you to target the problem ... |
Please see the corresponding issue in the cpython repo: python/cpython#116810 |
Thanks for the hint! Also linking the corresponding PR: python/cpython#123249. |
β I'm submitting a ...
π Describe the bug. What is the current behavior?
When enabling ssl_adapter on
WSGIServer
, there is a memory leak each time a connection is receivedβ What is the motivation / use case for changing the behavior?
π‘ To Reproduce
Using example code from cheroot with added
ssl_adapter
allows to reproduce the bugSteps to reproduce the behavior:
Run this server:
Make some requests:
for I in $(seq 2000); do wget --quiet -O /dev/null --no-check-certificate https://localhost:8078 ; done
See error:
read RSS value
from following command each time requests are made to serverps wu -p $(pgrep cheroot_test)
RSS value increases and never goes down.
π‘ Expected behavior
Stable memory consumption for a server usage
π Details
π Environment
π Additional context
OpenSSL has been compiled from https://www.openssl.org/source/openssl-3.0.13.tar.gz without any special option (except install prefix)
Python has been compiled from source https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tgz with following options
If you need more information or if I can help anyway tell me
The text was updated successfully, but these errors were encountered: