Author jnoller
Recipients jnoller
Date 2009-08-05.20:25:01
SpamBayes Score 2.30223e-09
Marked as misclassified No
Message-id <>
Additional comments from Sturla:

Hello Jesse,

Yes there is a bug in multiprocessing.


- Processes created by multiprocessing (mp.Process or mp.Pool) exit in a 
way that prevents the Python interpreter from running deallocation code 
for all extension objects (only the locals are cleaned up). Resources 
allocated by extension objects referenced in globals may leak 

Sub-processes seem to commit an ungraceful suicide on exit. If the 
kernel cleans up after a non-graceful exit this is ok. But if the kernel 
do not, as in the case of System V IPC objects, we have a permanent 
resource leak. This is very similar to the reason why manually killing 
threads is prohibited in Python.

I have example code to show this. It creates a system-wide memory leak 
on Linux/Unix (present until the next reboot), unless the last statement 
in the target of mp.Process ensures a manual clean up of the globals.
Date User Action Args
2009-08-05 20:25:02jnollersetrecipients: + jnoller
2009-08-05 20:25:02jnollersetmessageid: <>
2009-08-05 20:25:01jnollerlinkissue6653 messages
2009-08-05 20:25:01jnollercreate