Big memory leaks on PyPy (simplest usage)

The simplest usage of `requests` causes big memory leaks on PyPy (2.6.1, 4.0.0) and newest requests (2.8.1). The following script:

```
import requests
import time
import sys

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

        time.sleep(0.1)
        sys.stderr.write('.')
        sys.stderr.flush()

if __name__ == '__main__':
    main()
```

causes an increase of memory usage of about 1MB/second.

What does not help: creating and closing a `Session` for each request. What seems to help: using a global `Session`.

I have seen issues about it like https://github.com/kennethreitz/requests/issues/1685 but I'm not sure it was fixed and if it's regression.

Can connection pooling and keep-alive be disabled as a workaround? It seems like keep-alive is hardcoded now.

I don't see a leak on CPython, which probably means the bug must be caused by relying on reference counting sideeffects and incorrect cleanup code.

BTW, this line: https://github.com/kennethreitz/requests/blob/HEAD/requests/api.py#L54 should be wrapped around `try ... finally` (or `with ...`), unless session.request can't ever throw an exception.


This is quite puzzling. I ran the script for a long time, then broke into pdb.

``` python
(Pdb) objgraph.show_most_common_types(limit=20)
str               18275
function          5946
int               5812
code              4013
tuple             3548
builtin-code      2646
dict              880
unicode           766
type              719
builtin_function  686
getset_descriptor 447
list              434
module            243
staticmethod      189
set               184
property          173
method            143
weakref           129
classobj          116
long              113
(Pdb) objgraph.show_growth(limit=20)
list      435        +1
(Pdb) requests.get('https://www.bing.com/')
<Response [200]>
(Pdb) objgraph.show_growth(limit=20)
(Pdb)
```

Put another way, the simple act of calling requests.get does not seem to leak memory. This can be verified by removing the assignment to `r`: the leak is still present. I'm not really seeing any requests objects in memory at this point, which begins to suggest that this may be a PyPy problem, but I'll keep digging and see if I can shrink the repro code.


Alright, I can remove the leak by switching to `http://` instead of `https://`. Suggests this leak is either in PyPy's `ssl` module or in our (probably urllib3's) use of that module.


Well, not totally removed: I get a _much_ slower increase in memory usage. Like, 1/100 of what it was before.


This may actually be worse than it seems. objgraph's top 20 types are basically identical in the `http` and `https` cases, which may mean that the leak is actually in the C interface of PyPy's SSL module. I really hope it's not, so I'll try to construct a test case that disproves that hypothesis.


Yup, I can reproduce a consistent memory leak with just this code:

``` 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()
```


That makes this a PyPy bug, not a requests bug. There's no requests code in the above, but the problem still occurs.


And this does not leak in CPython 2.7.10. I need to update my PyPy version briefly to test on the most recent, but I'm pretty confident that this is a PyPy bug.


This issue can now be followed as [PyPy issue #2183](https://bitbucket.org/pypy/pypy/issues/2183/pypy-400-ssl-module-appears-to-leak-memory). Thanks for the report @aartur!