summaryrefslogtreecommitdiff
path: root/proc.py
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2009-07-19 02:07:55 +0200
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2009-07-19 02:07:55 +0200
commita1cdde3320add8bbe4557639488bb4d2ef2861fd (patch)
treef579949c7a7fb9b4efb8a6ccdfcd35484854662b /proc.py
parent6bb5a230a8df5ed2fe417c7b85491073da50dfd3 (diff)
downloadlogilab-common-a1cdde3320add8bbe4557639488bb4d2ef2861fd.tar.gz
[cleanup] delete-trailing-whitespace
Diffstat (limited to 'proc.py')
-rw-r--r--proc.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/proc.py b/proc.py
index 76503d2..d6e8923 100644
--- a/proc.py
+++ b/proc.py
@@ -52,7 +52,7 @@ class ProcInfo(Node):
return int(self.status()[VSIZE])
except IOError:
return 0
-
+
def lineage_memory_usage(self):
return self.memory_usage() + sum(child.lineage_memory_usage() for child in self.children)
@@ -81,7 +81,7 @@ class ProcInfo(Node):
class ProcInfoLoader:
"""manage process information"""
-
+
def __init__(self):
self._loaded = {}
@@ -101,8 +101,8 @@ class ProcInfoLoader:
procinfo.manager = self
self._loaded[pid] = procinfo
return procinfo
-
-
+
+
def load_all(self):
"""load all processes information"""
for pid in self.list_pids():
@@ -153,11 +153,11 @@ class MemorySentinel(Thread):
self.interval = interval
self.setDaemon(True)
self.gpid = gpid
-
+
def stop(self):
"""stop ap"""
self._stop.set()
-
+
def _run(self):
pil = ProcInfoLoader()
while not self._stop.isSet():
@@ -190,7 +190,7 @@ class ResourceController:
def _hangle_sig_timeout(self, sig, frame):
raise TimeoutError()
-
+
def _hangle_sig_memory(self, sig, frame):
if self._abort_try < self._reprieve:
self._abort_try += 1
@@ -214,7 +214,7 @@ class ResourceController:
self._timer.start()
else:
os.killpg(os.getpid(), SIGKILL)
-
+
def setup_limit(self):
"""set up the process limit"""
assert currentThread().getName() == 'MainThread'