Author mythsmith
Recipients mythsmith
Date 2014-02-17.15:47:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I seems that upon the start of a second manager, all objects referenced in the first one gets an INCREF. On the third start, all objects created by the first and the second manager get another INCREF. And so on. I cannot understand why the start of a totally new manager, in a new process, will cause all these INCREF about object hosted on other managers - which cause the program to take forever to start/stop.

This small script fully reproduces the behaviour, tested in python 2.7 and 3.2:

from __future__ import print_function
import multiprocessing, logging
# # Activate multiprocessing logging
mplog = multiprocessing.get_logger()
def newman(n=50):
    global objs
    for i in range(n):
    return m    

print('#### first man')

print ('#### second man')

print ('#### third man')

(Output is attached)

After the start of the first manager, the logger prints out the messages relative to the creation of the first 50 objects.

But when the second manager is starting - before any object was created by it - the logger prints out exactly 50 INCREF messages.Then follows the messages relating to the creation of the 50 new objects on manager 2.

When the third manager starts - before any object was created by it - 100 more INCREF messages are printed.

No object creation message is seen after m3 creation, as I passed 0 to the newman() function.

When the program ends, a similar amount of DECREF messages is printed.

It seems that, when I start a new manager, it creates a reference to all objects referenced by previous managers. In a big application this translates into extremely slow startup/shutdown.
Date User Action Args
2014-02-17 15:47:05mythsmithsetrecipients: + mythsmith
2014-02-17 15:47:05mythsmithsetmessageid: <>
2014-02-17 15:47:05mythsmithlinkissue20660 messages
2014-02-17 15:47:04mythsmithcreate