Instead of 10 minutes AND all RAM used. It takes ages to fill all the
RAM on machines with 8GB or 32GB.
if not rootdir.startswith('/var/lib/schroot/mount'): continue
#
used = p.get_memory_info().vms
if not rootdir.startswith('/var/lib/schroot/mount'): continue
#
used = p.get_memory_info().vms
- if used < total_mem: continue
- #
cputime = p.get_cpu_times().user
cputime = p.get_cpu_times().user
- if cputime < cutoff_time: continue
+ if used < total_mem and cputime < cutoff_time: continue
#
p.kill()
except psutil.NoSuchProcess:
#
p.kill()
except psutil.NoSuchProcess: