简体   繁体   English

铅泄漏的Popen物体

[英]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。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM