chore: periodic gc.collect() on HTTP thread after disabling GC for RT
CI / test (push) Has been cancelled
CI / test (push) Has been cancelled
This commit is contained in:
@@ -845,6 +845,7 @@ def main() -> int:
|
|||||||
try:
|
try:
|
||||||
import gc
|
import gc
|
||||||
gc.disable()
|
gc.disable()
|
||||||
|
gc.collect() # One final sweep to clear boot-time cyclic garbage
|
||||||
logger.info("GC disabled for RT audio stability")
|
logger.info("GC disabled for RT audio stability")
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.warning("Could not disable GC: %s", exc)
|
logger.warning("Could not disable GC: %s", exc)
|
||||||
|
|||||||
+9
-2
@@ -487,9 +487,16 @@ class WebServer:
|
|||||||
"""Full pedal state snapshot.
|
"""Full pedal state snapshot.
|
||||||
|
|
||||||
Without parameters returns the active (guitar) channel's flat state.
|
Without parameters returns the active (guitar) channel's flat state.
|
||||||
``?channel=guitar|bass`` returns per-channel state.
|
?channel=guitar|bass returns per-channel state.
|
||||||
``?combined=true`` returns both channel states in a combined view.
|
?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:
|
if combined:
|
||||||
state = self._gather_state_combined()
|
state = self._gather_state_combined()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user