Improve memory_pressure management
Created originally on Bitbucket by pjenvey (Philip Jenvey)
cffi's docs now recommend manually adding memory_pressure anywhere ext. allocations are tied into pypy's GC.
This is inconvenient w/ a lib like cryptography: it's often allocating via OpenSSL's own functions, all tied into ffi.gc. In some cases cryptography doesn't even know the underlying size of what it's allocated.
It's doesn't add memory pressure currently which can exhibit itself as memory leaks under heavy usage (e.g. https://github.com/mozilla-services/autopush/issues/917)
Instead of forcing every lib to call a __pypy__
specific function, can cffi be improved?
Maybe ffi.gc can arbitrarily add memory pressure itself? Gain an optional size argument for cases that know the memory pressure size, otherwise guess? Could there be some added pypy GC heuristics that improve such a "guess"?