Cleanup psutil cache after iterations

This commit is contained in:
Oleksii Shevchuk 2018-03-12 17:09:49 +02:00
parent 3a0af29aa3
commit f665463bc3
1 changed files with 4 additions and 0 deletions

View File

@ -68,6 +68,7 @@ def psinfo(pids):
pid: info
})
psutil._pmap = {}
return data
def pstree():
@ -118,6 +119,7 @@ def pstree():
if 0 in tree and 0 in tree[0]:
tree[0].remove(0)
psutil._pmap = {}
return min(tree), tree, data
def users():
@ -173,6 +175,7 @@ def users():
info[term.name][host].append(terminfo)
psutil._pmap = {}
return info
def connections():
@ -202,6 +205,7 @@ def connections():
connections.append(obj)
psutil._pmap = {}
return connections
def _tryint(x):