[New-bugs-announce] [issue13542] Memory leak in multiprocessing.pool

Yang Zhang report at bugs.python.org
Tue Dec 6 21:28:30 CET 2011

New submission from Yang Zhang <yang.pythonbugs at mailnull.com>:

Calling Pool.map (and friends) on empty lists [] causes Pool._cache to hang on to the MapResults forever:

tp = ThreadPool(5)
xs = tp.map(lambda x: 'a' * int(10e6), range(100))
# now using 1GB mem = 100 * 10MB strs
del xs
# still using 1GB mem
tp.close(); tp.join()
# now using ~0GB mem

components: Library (Lib)
messages: 148937
nosy: yang
priority: normal
severity: normal
status: open
title: Memory leak in multiprocessing.pool
type: resource usage
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list