[Support]: OOM Killer on Raspberry Pi 5 with Coral USB TPU Causes frigate.db Corruption in v0.16.1 with 5 Dahua RTSP Cameras #20258
Replies: 1 comment
-
This appears to be a memory leak issue causing OOM kills that corrupt the database. Based on the documentation, there are several configuration adjustments you can make to address this: Memory Configuration IssuesYour current Hardware AccelerationThe documentation recommends hardware acceleration to minimize CPU usage (2). Your configuration shows "WARNING: Did not detect hwaccel", which means you're likely using CPU-only decoding, significantly increasing memory usage (3). The documentation states "Decompressing video streams takes a significant amount of CPU power" and "Higher resolutions and frame rates mean more processing power is needed to decode the video stream" (3). Similar Issues in CommunityThe GitHub discussions show this is a known pattern (4) (5). Users report memory leaks in Recommended Solutions
The memory leaks appear to be triggered by unstable RTSP connections, which matches the pattern described in the GitHub discussions where network timeouts cause capture processes to consume excessive memory (5). 📚 Sources:
Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checklist
Describe the problem you are having
Frigate fails to start with the error "database disk image is malformed" in frigate.db after recurrent OOM kills caused by memory leaks in frigate.detecto, frigate.capture, and FFmpeg processes. This occurs after ~7 days of uptime with 5 Dahua RTSP cameras (640x360@5fps, dual streams subtype=0/1/2). Recreating frigate.db resolves the issue temporarily, but memory leaks return, triggering OOM Killer and corrupting the database again. Suspected unstable RTSP streams on the 192.168.20.x subnet contribute to FFmpeg leaks, exacerbated by high load from 5 cameras on a Raspberry Pi 5 (8 GB RAM).
Steps to reproduce
Version
0.16.1
In which browser(s) are you experiencing the issue with?
No response
Frigate config file
docker-compose file or Docker CLI command
Relevant Frigate log output
Relevant go2rtc log output
.
Operating system
Other Linux
Install method
Docker Compose
Network connection
Wired
Camera make and model
Dahua
Screenshots of the Frigate UI's System metrics pages
.
Any other information that may be helpful
Environment
Frigate version: 0.16.1-standard-arm64
Operating system: Raspberry Pi OS (Bookworm, kernel 6.12.34+rpt-rpi-2712, aarch64)
Hardware: Raspberry Pi 5 (8 GB RAM), Coral USB TPU (connected to USB3 port)
Storage: SD card [brand and class, e.g., SanDisk A1, if known]
Network: Cameras on 192.168.20.x subnet, [Ethernet/WiFi, specify]
Camera details: 5 Dahua RTSP cameras, 640x360@5fps, dual streams (subtype=1 detect, subtype=0/2 record), audio enabled on CAM01/CAM03/CAM04
Coral TPU: Configured as detectors: coral: type: edgetpu device: usb, no errors in logs but high RAM usage suggests possible fallback to CPU
FFmpeg hwaccel: Not detected (WARNING: Did not detect hwaccel), using /dev/video11 mapping
Additional context
Reproduction: Runs ~7 days, memory grows (leaks in frigate.capture/FFmpeg), OOM Killer terminates frigate.detecto (2.7 GB RSS), python3 (2.7 GB RSS), and FFmpeg processes, leading to corrupted writes to frigate.db. Restart fails with DatabaseError. Recreating frigate.db resolves temporarily, but leaks persist.
Workarounds applied: Increased shm_size to 512mb, added mem_limit: 4g, recreated frigate.db. Disabled audio and reduced cameras (CAM03/CAM04) temporarily to test. Streams tested with ffplay, appear stable but possible latency in 192.168.20.x subnet.
Related issues/discussions: Possible partial duplicate of:
#19925 (FFmpeg/frigate.capture memory leaks causing OOM)
#9914 (frigate.db corruption in Home Assistant)
#18321 (OOM in LXC with frigate.capture leaks)
#8965 (Coral USB issues on Pi 5)
#16564 (DB corruption during VM migration, identical logs)
No exact match for Pi 5 + v0.16.1 + DB corruption due to OOM with 5 Dahua cameras.
Beta Was this translation helpful? Give feedback.
All reactions