chore: periodic gc.collect() on HTTP thread after disabling GC for RT
CI / test (push) Has been cancelled

This commit is contained in:
2026-06-18 18:28:18 -04:00
parent d7889c6f23
commit 0cb044fb5e
2 changed files with 10 additions and 2 deletions
+1
View File
@@ -845,6 +845,7 @@ def main() -> int:
try:
import gc
gc.disable()
gc.collect() # One final sweep to clear boot-time cyclic garbage
logger.info("GC disabled for RT audio stability")
except Exception as exc:
logger.warning("Could not disable GC: %s", exc)
+9 -2
View File
@@ -487,9 +487,16 @@ class WebServer:
"""Full pedal state snapshot.
Without parameters returns the active (guitar) channel's flat state.
``?channel=guitar|bass`` returns per-channel state.
``?combined=true`` returns both channel states in a combined view.
?channel=guitar|bass returns per-channel state.
?combined=true returns both channel states in a combined view.
"""
# Periodic GC collection — GC is disabled for RT audio stability,
# so collect cyclics here on the HTTP thread every state poll (~2s)
try:
import gc
gc.collect()
except Exception:
pass
if combined:
state = self._gather_state_combined()
else: