State in log that memory handler kills OpenOffice process because of memory consumption limit.

Also log the current memory usage before killing.
parent f281ea03
...@@ -69,8 +69,11 @@ class MonitorMemory(Monitor, Process): ...@@ -69,8 +69,11 @@ class MonitorMemory(Monitor, Process):
self.status_flag = True self.status_flag = True
logger.debug("Start MonitorMemory") logger.debug("Start MonitorMemory")
while self.status_flag: while self.status_flag:
if self.get_memory_usage() > self.limit: memory_usage = self.get_memory_usage()
logger.debug("Stopping OpenOffice") if memory_usage > self.limit:
logger.debug("OpenOffice memory consumption limit has been "
"reached: Current usage: %sMB, limit: %sMB. Stopping OpenOffice."
% (memory_usage, self.limit))
self.openoffice.stop() self.openoffice.stop()
sleep(self.interval) sleep(self.interval)
logger.debug("Stop MonitorMemory") logger.debug("Stop MonitorMemory")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment