On 02.09.24 18:02, cpbu...@gmail.com wrote:
This is just my 2 cents as a PyPy user. CPython eagerly destroys unreferenced objects while PyPy will destroy them eventually. I ran into a problem with the requests library where it would create connection pool object every request, and the unreferenced pool would not be cleaned up immediately which caused the maximum number of open file descriptors to be reached (if I recall correctly). The solution to my case was calling `gc.collect_step()` (a PyPy-only function) after each request. You can also try the standard `gc.collect()` function which may be more reliable for a unit test to ensure any unreferenced objects are garbage collected. This may not help with the general use of your library though.
We have similar issues with garbage collection in PySide on PyPy. To reliably get rid of objects, we are calling gc.collect() twice. ciao -- Chris -- Christian Tismer-Sperling :^) tis...@stackless.com Software Consulting : http://www.stackless.com/ Strandstr. 37 : https://www.qt.io/qt-for-python 24217 Schönberg : GPG key -> 0xE7301150FB7BEE0E phone +49 176 624 88888 _______________________________________________ pypy-dev mailing list -- pypy-dev@python.org To unsubscribe send an email to pypy-dev-le...@python.org https://mail.python.org/mailman3/lists/pypy-dev.python.org/ Member address: arch...@mail-archive.com