[docs] [issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

tzickel report at bugs.python.org
Mon Jul 23 12:26:46 EDT 2018


tzickel <icebreak at yahoo.com> added the comment:

I think I've found the code bug causing the leak:

https://github.com/python/cpython/blob/caa331d492acc67d8f4edd16542cebfabbbe1e79/Lib/multiprocessing/pool.py#L180

There is a circular reference between the Pool object, and the self._worker_handler Thread object (and it's also saved in the frame locals for the thread object, which prevents it from being garbage collected).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34172>
_______________________________________


More information about the docs mailing list