[pypy-issue] Issue #2183: PyPy 4.0.0 SSL module appears to leak memory. (pypy/pypy)
Cory Benfield
issues-reply at bitbucket.org
Fri Nov 6 10:50:34 EST 2015
New issue 2183: PyPy 4.0.0 SSL module appears to leak memory.
https://bitbucket.org/pypy/pypy/issues/2183/pypy-400-ssl-module-appears-to-leak-memory
Cory Benfield:
Originally raised as [Requests issue #2862](https://github.com/kennethreitz/requests/issues/2862).
It seems that somewhere in the PyPy stack, the SSL module leaks memory. The following script slowly but indefinitely leaks memory on my machine (OS X 10.11 El Capitan) under the latest two PyPy releases (4.0.0 and 2.6.1) at least. The script does not leak under CPython 2.7.10.
The script is below:
```
#!python
import gc
import time
import socket
import ssl
import sys
def main():
while True:
ctx = ssl.create_default_context()
s = socket.create_connection(('www.bing.com', 443))
s = ctx.wrap_socket(s, server_hostname='www.bing.com')
s.close()
time.sleep(0.1)
sys.stderr.write('.')
sys.stderr.flush()
gc.collect()
if __name__ == '__main__':
main()
```
Please let me know if there's any additional diagnostics you'd like to see.
More information about the pypy-issue
mailing list