object won't die (still references to it that I can't find)

Posted by user288558 on Stack Overflow See other posts from Stack Overflow or by user288558
Published on 2010-04-15T09:30:14Z Indexed on 2010/04/15 9:33 UTC
Read the original article Hit count: 406

I'm using parallel-python and start a new job server in a function. after the functions ends it still exists even though I didn't return it out of the function (I used weakref to test this). I guess there's still some references to this object somewhere. My two theories: It starts threads and it logs to root logger.

My questions: can I somehow findout in which namespace there is still a reference to this object. I have the weakref reference. Does anyone know how to detach a logger? What other debug suggestions do people have?

here is my testcode:

def pptester():

js=pp.Server(ppservers=nodes)
js.set_ncpus(0)
fh=file('tmp.tmp.tmp','w')  
tmp=[]
for i in range(200):
    tmp.append(js.submit(ppworktest,(),(),('os','subprocess')))
js.print_stats()
return weakref.ref(js)

thanks in advance Wolfgang

© Stack Overflow or respective owner

Related posts about python

Related posts about parallel-python