Skip to content

Commit ff2cf5b

Browse files
committed
Increase minimum full-GC interval
1 parent bed5a38 commit ff2cf5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/flitter/engine/control.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
class EngineController:
2323
STATE_SAVE_PERIOD = 1
24+
MINIMUM_GC_INTERVAL = 10
2425

2526
def __init__(self, target_fps=60, screen=0, fullscreen=False, vsync=False, state_file=None,
2627
reset_on_switch=False, state_simplify_wait=0, realtime=True, defined_names=None, vm_stats=False,
@@ -295,7 +296,7 @@ async def run(self):
295296
del context
296297
SharedCache.clean()
297298
gc_pending |= Model.flush_caches()
298-
if gc_pending and (last_gc is None or now > last_gc + 1):
299+
if gc_pending and (last_gc is None or now > last_gc + self.MINIMUM_GC_INTERVAL):
299300
count = gc.collect(2)
300301
gc_pending = False
301302
last_gc = now

0 commit comments

Comments
 (0)