Author sbt
Recipients mythsmith, sbt
Date 2014-02-18.20:31:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
On Unix, using the fork start method (which was the only option till 3.4), every sub process will incref every shared object for which its parent has a reference.

This is deliberate because there is not really any way to know which shared objects a subprocess might use.  (On Windows where only things pickled as part of the process object are inherited by the child process, we can know exactly which shared objects the child process should incref.)

Typical programs will only have a single manager (or a very small number) but may have a large number of normal processes (which will also do the increfing).  I do not think that this is worth trying to fix, particularly as it can cause compatibility problems.

For 3.4 you can use the "spawn" or "forkserver" start methods instead.

import multiprocessing, logging

objs = []

def newman(n=50):
    m = multiprocessing.Manager()
    for i in range(n):
    return m

def foo():

if __name__ == '__main__':
    ## Try uncommenting next line with Python 3.4
    # multiprocessing.set_start_method('spawn')
    print('#### first man')
    m1 = newman()
    print('#### starting foo')
    p = multiprocessing.Process(target=foo)
Date User Action Args
2014-02-18 20:31:52sbtsetrecipients: + sbt, mythsmith
2014-02-18 20:31:52sbtsetmessageid: <>
2014-02-18 20:31:52sbtlinkissue20660 messages
2014-02-18 20:31:51sbtcreate