STINNER Victor <vstin...@python.org> added the comment:
> I changed dash_R_cleanup to put the sys._clear_type_cache() after > clear_caches() and the leak is gone Aha! The order of function calls in dash_R_cleanup() matters. Calling sys._clear_type_cache() at the end of dash_R_cleanup() perfectly makes sense. If you do that, please add a comment to explain that the order matters. For example, the code about ABC classes is likely to modify classes. About the gc_collect() call, I dislike calling it in clear_caches() and then again in dash_R_cleanup(). I would even prefer to *remove* it from both functions and call it explicitly at the call site: in dash_R() and in runtest.py. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44895> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com