[英]plumbum leaking Popen objects
I have a daemon-like process which runs commands in subprocesses using plumbum
. 我有一个类似于守护程序的进程,该进程使用
plumbum
在子进程中运行命令。 I noticed it leaks Popen
objects. 我注意到它泄漏了
Popen
对象。
Easy to reproduce: 易于复制:
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)]
Is this a bug? 这是错误吗? (I couldn't find where to report bugs in plumbum...)
(我找不到在哪里报告铅球中的错误...)
I also "experimented" with modifying the leaking Popen
objects, trying to break the reference-cycle (assuming one exists, to cause the leak), but it didn't help. 我还对修改泄漏的
Popen
对象进行了“实验”,试图打破参考循环(假设存在一个引用循环,导致泄漏),但这并没有帮助。
Running on linux, plumbum version 1.14.0. 在Linux上运行,铅版本为1.14.0。
It's been fixed, aren't you the one who opened that issue? 已经解决了,您不是打开这个问题的人吗?
issue: https://github.com/tomerfiliba/plumbum/issues/166 commit: https://github.com/tomerfiliba/plumbum/commit/a565720631b210642fb6f2f7e9e6bb59e7e395e1 问题: https : //github.com/tomerfiliba/plumbum/issues/166提交: https : //github.com/tomerfiliba/plumbum/commit/a565720631b210642fb6f2f7e9e6bb59e7e395e1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.