Message289954
When upgrading to 3.5.3 we noticed that the requests module was leaking memory rather quickly. This led to me logging the issue: https://github.com/kennethreitz/requests/issues/3933. After more investigation I've found that the leak is caused by the raw python SSL sockets. I've created a test file here: https://gist.github.com/thehesiod/ef79dd77e2df7a0a7893dfea6325d30a which allows you to reproduce the leak with raw python ssl socket (CLIENT_TYPE = ClientType.RAW), aiohttp or requests. They all leak in a similar way due to their use of the python SSL socket objects. I tried tracing the memory usage with tracemalloc but nothing interesting popped up so I believe this is a leak in the native code.
A docker cloud image is available here: amohr/testing:stretch_request_leak based on:
```
FROM debian:stretch
COPY request_https_leak.py /tmp/request_https_leak.py
RUN apt-get update && \
apt-get install -y python3.5 python3-pip git
RUN python3 -m pip install requests git+git://github.com/thehesiod/pyca.git@fix-py3#egg=calib setproctitle requests psutil
```
I believe this issue was introduced in python 3.5.3 as we're not seeing the leak with 3.5.2. Also I haven't verified yet if this happens on non-debian systems. I'll update if I have any more info. I believe 3.6 is similarly impacted but am not 100% certain yet. |
|
Date |
User |
Action |
Args |
2017-03-22 01:10:31 | thehesiod | set | recipients:
+ thehesiod, christian.heimes |
2017-03-22 01:10:31 | thehesiod | set | messageid: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> |
2017-03-22 01:10:30 | thehesiod | link | issue29870 messages |
2017-03-22 01:10:30 | thehesiod | create | |
|