From e17cefd61cbd234e7dab8b94d4847858b29c0e40 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 24 Mar 2023 10:24:02 -1000 Subject: [PATCH] Clear recorder startup tasks from memory after processing (#90240) Co-authored-by: Paulus Schoutsen --- homeassistant/components/recorder/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/recorder/core.py b/homeassistant/components/recorder/core.py index 8e522a2bbd9..3b92698c83d 100644 --- a/homeassistant/components/recorder/core.py +++ b/homeassistant/components/recorder/core.py @@ -779,6 +779,10 @@ class Recorder(threading.Thread): for task in startup_tasks: self._guarded_process_one_task_or_recover(task) + # Clear startup tasks since this thread runs forever + # and we don't want to hold them in memory + del startup_tasks + self.stop_requested = False while not self.stop_requested: self._guarded_process_one_task_or_recover(queue_.get())