[New-bugs-announce] [issue26180] multiprocessing.util._afterfork_registry leak in threaded environment

Milan Zamazal report at bugs.python.org
Fri Jan 22 10:24:46 EST 2016


New submission from Milan Zamazal:

When calling multiprocessing.managers.BaseManager repeatedly from a client, each time from a new thread, new entry with (already existent) multiprocessing.util.ForkAwareLocal instance is inserted as a value into multiprocessing.util._afterfork_registry dictionary on each of the calls.  So the dictionary grows on each client call and may grow so indefinitely, causing memory leak if nothing else.

The attached file demonstrates the problem (Python 2.7 version, it's reproducible on 3.4 as well after 2->3 adjustments).  Just run it and look at the output.  The printed dictionary contains 10 entries holding the same ForkAwareLocal instance although there should be probably just one such entry there.

----------
components: Library (Lib)
files: bug.py
messages: 258816
nosy: mzamazal
priority: normal
severity: normal
status: open
title: multiprocessing.util._afterfork_registry leak in threaded environment
type: resource usage
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file41690/bug.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26180>
_______________________________________


More information about the New-bugs-announce mailing list