Disable history when --memory-leak option is used

pull/2011/head
nicolargo 2022-02-25 11:20:15 +01:00
parent 1d222ff8a0
commit bc47db9924
2 changed files with 4 additions and 4 deletions

View File

@ -125,7 +125,8 @@ def start(config, args):
args.stop_after * args.time * args.memory_leak * 2))
if args.memory_leak:
print('Memory leak detection, please wait...')
print('Memory leak detection, please wait ~{} seconds...'.format(
args.stop_after * args.time * args.memory_leak * 2))
# First run without dump to fill the memory
mode.serve_n(args.stop_after)
# Then start the memory-leak loop
@ -142,8 +143,7 @@ def start(config, args):
snapshot_end = tracemalloc.take_snapshot()
snapshot_diff = snapshot_end.compare_to(snapshot_begin, 'filename')
memory_leak = sum([s.size_diff for s in snapshot_diff])
print("Memory comsumption for {} refreshs: {}KB (see log for details)".format(
args.stop_after,
print("Memory comsumption: {0:.1f}KB (see log for details)".format(
memory_leak / 1000))
logger.info("Memory consumption (top 5):")
for stat in snapshot_diff[:5]:

View File

@ -705,7 +705,7 @@ Examples of use:
if not self.args.stop_after:
self.args.stop_after = 60
self.args.time = 1
self.disable_history = True
self.args.disable_history = True
# Let the plugins known the Glances mode
self.args.is_standalone = self.is_standalone()