[Bug]: memory leak when accessing an event #16581
Unanswered
jerome71
asked this question in
Report a Bug
Replies: 1 comment 2 replies
-
A memory leak is a very specific thing which means memory is allocated and then not released despite not being in use. In order to have evidence of a memory leak, we will need more in-depth information of specifically what is using memory, and if it truly is not being used any longer.
this is really pushing it, especially for the number of cameras that you have. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checklist
Describe the problem you are having
This is on a Raspberry Pi 5 8GB with a Coral USB TPU and a 4GB USB SSD for media storage.
I could see that, after a moment, accessing an event would take a very long time (accessing the page with the list of event works well), and would again be quick after restarting Frigate (from the UI or any other way).
Since version 0.15.0, it came to the point the Pi would become unresponsive (no SSH access, no web serving etc.), but would usually regain consciousness after a few minutes.
After analyzing logs, it appears the Pi was out of memory (and therefore wrote a swap file to the SD card, which cannot go well).
After introducing memory limits for the frigate process in the docker-compose file, the Pi remains responsive, but, often, when watching an event, frigate quits and relaunchs. After a few seconds to a minute, when reloading the page, the event plays as it should.
Steps to reproduce
...
Version
0.15.0-cea210d
In which browser(s) are you experiencing the issue with?
Safari 18.3 (20620.2.4.11.5) on macOS 15.3.1 (Apple Silicon)
Frigate config file
docker-compose file or Docker CLI command
Relevant Frigate log output
Relevant go2rtc log output
Nothing relevant. 2025-02-14 16:50:13.636508161 [INFO] Preparing new go2rtc config... 2025-02-14 16:50:14.511770148 [INFO] Not injecting WebRTC candidates into go2rtc config as it has been set manually 2025-02-14 16:50:14.920977284 [INFO] Starting go2rtc... 2025-02-14 16:50:15.092252617 16:50:15.089 INF go2rtc platform=linux/arm64 revision=b2399f3 version=1.9.2 2025-02-14 16:50:15.092258728 16:50:15.089 INF config path=/dev/shm/go2rtc.yaml 2025-02-14 16:50:15.092265562 16:50:15.090 INF [api] listen addr=:1984 2025-02-14 16:50:15.092462395 16:50:15.092 INF [rtsp] listen addr=:8554 2025-02-14 16:50:15.093954227 16:50:15.093 INF [webrtc] listen addr=:8555 2025-02-14 16:50:23.648283746 [INFO] Starting go2rtc healthcheck service...
Operating system
Other Linux
Install method
Docker Compose
Network connection
Wired
Camera make and model
Dahua DH-P5D-5F-PV
Screenshots of the Frigate UI's System metrics pages
(please note that the alert is related to the CPU being used to create the detect stream for a camera - top shows 40% CPU available on the Pi)



20240214 - General Stats - Frigate.pdf
20240214 - Storage Stats - Frigate.pdf
20240214 - Cameras Stats - Frigate.pdf
Any other information that may be helpful
Seems to crash way more than 0.14.1.
Tried removing TLS config and using ffmpeg 5 with no success.
I put the memory limits in the docker compose file so that the crash resulted in a Frigate restart instead of the Pi becoming unresponsive.
The Python process usually uses betwen 1.4GB and 1.8GB, so 3.5GB should be plenty enough, why not triggering a memory swap.
Here is the Raspberry Pi log that indicated a memory leak from the Python process: "Out of memory: Killed process 19165 (python3) total-vm:5438768kB, anon-rss:2547392kB..." from this file
Kernel Crash Raspberry Pi 20250214.txt
Beta Was this translation helpful? Give feedback.
All reactions