ocrd process: memory_usage w/ multiprocess and include_children
@@ -71,11 +71,10 @@ def run_processor(
log.debug("Processor instance %s (%s doing %s)", processor, name, otherrole)
t0_wall = perf_counter()
t0_cpu = process_time()
- mem_usage = memory_usage(proc=processor.process, interval=.1, timeout=None, timestamps=True)
+ mem_usage = memory_usage(proc=processor.process, interval=.1, timeout=None, timestamps=True, multiprocess=True, include_children=True)
mem_usage_values = [mem for mem, _ in mem_usage]
mem_output = 'memory consumption: '
mem_output += ''.join(sparklines(mem_usage_values))
- mem_output += '\n'
mem_output += ' max: %.2f MiB min: %.2f MiB' % (max(mem_usage_values), min(mem_usage_values))
logProfile.info(mem_output)
t1_wall = perf_counter() - t0_wall
