fix: release graph_runtime_state reference to prevent memory leak

Release the _graph_runtime_state reference in stop_listen() to allow
Python GC to reclaim memory immediately after request completion.

Without this fix, the reference chain:
  AppQueueManager._graph_runtime_state -> GraphRuntimeState -> Graph -> Node -> graph_runtime_state
prevents garbage collection until the entire pipeline object is released,
causing memory to accumulate under high concurrency.

Fixes #30183

Signed-off-by: SherlockShemol <shemol@163.com>
This commit is contained in:
SherlockShemol 2025-12-27 06:50:19 +00:00
parent c393d7a2dc
commit db5462b2ba
1 changed files with 1 additions and 0 deletions

View File

@ -90,6 +90,7 @@ class AppQueueManager:
"""
self._clear_task_belong_cache()
self._q.put(None)
self._graph_runtime_state = None # Release reference to allow GC to reclaim memory
def _clear_task_belong_cache(self) -> None:
"""