From cb0a8f2ed9d5895e7b07a3783f00205f33e23203 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 16 Sep 2020 22:23:44 -0400 Subject: reactor: Add support for explicit Python garbage collection Add support for performing Python gc work only from the main reactor thread and only when it appears the main thread is idle. Signed-off-by: Kevin O'Connor --- klippy/klippy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'klippy/klippy.py') diff --git a/klippy/klippy.py b/klippy/klippy.py index 03095d06..325d6fa3 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -306,6 +306,7 @@ def main(): elif not options.debugoutput: logging.warning("No log file specified!" " Severe timing issues may result!") + gc.disable() # Start Printer() class while 1: @@ -313,7 +314,7 @@ def main(): bglogger.clear_rollover_info() bglogger.set_rollover_info('versions', versions) gc.collect() - main_reactor = reactor.Reactor() + main_reactor = reactor.Reactor(gc_checking=True) printer = Printer(main_reactor, bglogger, start_args) res = printer.run() if res in ['exit', 'error_exit']: -- cgit v1.2.3-70-g09d2