[pypy-issue] Issue #2184: Big memory leaks when using requests (pypy/pypy)

artur issues-reply at bitbucket.org
Sat Nov 7 03:31:04 EST 2015

New issue 2184: Big memory leaks when using requests


This is related to #2183 (I don't have rights to reopening an issue, and the area seems to be broader than SSL so I'm creating a new issue).

The original test script from the [github issue 2862](https://github.com/kennethreitz/requests/issues/2862) still causes a very big memory leak (a few MB/s). The script:


import requests
import time
import sys

def main():
    while True:
        r = requests.get('https://www.bing.com/')


if __name__ == '__main__':

I tested it using PyPy built from 2690aff7d7b0 (-Ojit targetpypystandalone). I don't see a major improvement compared to 4.0.0.

The script from #2183 still seems to leak memory using the newest PyPy, although a little slower. Note also that that script caused a much smaller leak than the original one that used `requests`, which probably means the leaking area is broader than SSL alone.

Overall the issue is fairly critical, because it makes PyPy unsuitable for any long running server process that uses the `requests` library even in the simplest forms.

More information about the pypy-issue mailing list