This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年12月06日 20:28 by yang, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg148937 - (view) | Author: Yang Zhang (yang) | Date: 2011年12月06日 20:28 | |
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 gc.collect() # still using 1GB mem tp.close(); tp.join() # now using ~0GB mem |
|||
| msg148938 - (view) | Author: Yang Zhang (yang) | Date: 2011年12月06日 20:39 | |
Oops, sorry - pasted a wrong example.
In [38]: tp = ThreadPool(5)
In [39]: xs = tp.map(lambda x: x, [])
In [40]: xs
Out[40]: []
In [41]: tp._cache
Out[41]: {3: <multiprocessing.pool.MapResult at 0x244ab50>}
|
|||
| msg148980 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2011年12月07日 17:49 | |
It's a duplicate of #12157. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:24 | admin | set | github: 57751 |
| 2011年12月07日 17:49:26 | neologix | set | status: open -> closed superseder: join method of multiprocessing Pool object hangs if iterable argument of pool.map is empty nosy: + neologix messages: + msg148980 resolution: duplicate stage: needs patch -> resolved |
| 2011年12月07日 08:42:21 | ezio.melotti | set | nosy:
+ jnoller stage: needs patch versions: - Python 2.6, Python 3.1, Python 3.4 |
| 2011年12月06日 20:39:25 | yang | set | messages: + msg148938 |
| 2011年12月06日 20:28:29 | yang | create | |