mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-10 08:17:52 -06:00
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 <kevin@koconnor.net>
This commit is contained in:
parent
73cd8c241c
commit
cb0a8f2ed9
2 changed files with 38 additions and 15 deletions
|
@ -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']:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue