简体   繁体   中英

plumbum leaking Popen objects

I have a daemon-like process which runs commands in subprocesses using plumbum . I noticed it leaks Popen objects.

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.

Running on linux, plumbum version 1.14.0.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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