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):
self.status_flag = True
logger.debug("Start MonitorMemory")
while self.status_flag:
if self.get_memory_usage() > self.limit:
logger.debug("Stopping OpenOffice")
memory_usage = self.get_memory_usage()
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()
sleep(self.interval)
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