我有一个类似守护进程的进程,它使用plumbum
在子进程中运行命令。我注意到它泄漏了Popen
个对象。你知道吗
易于复制:
from plumbum.cmd import ls
x = [ ls() for i in range(500) ]
del x
import gc
gc.collect()
import objgraph
[ x for x in objgraph.most_common_types(10000) if 'Popen' in str(x) ]
=> [('Popen', 500)]
这是虫子吗?(我找不到报告铅中毒的地方……)
我还“试验”了修改泄漏的Popen
对象,试图打破引用循环(假设存在引用循环,从而导致泄漏),但没有任何帮助。你知道吗
在linux上运行,plumbum版本1.14.0。你知道吗
已经修好了,不是你开的那个问题吗?你知道吗
问题:https://github.com/tomerfiliba/plumbum/issues/166 提交:https://github.com/tomerfiliba/plumbum/commit/a565720631b210642fb6f2f7e9e6bb59e7e395e1
相关问题 更多 >
编程相关推荐