-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High RAM usage and unexpected restart of Home Assistant #1241
Comments
I'm not Alex, but I've been investigating similar issues
I would also double check that your log level is set to debug or trace if you aren't seeing errors. If you are on info, most errors won't get reported. |
Are you using an audio stream with it? I would encourage you to check the things I listed above to help identify the source of the issue |
Memory graph screenshots are not much help to understand and detect the problem. |
In my case I solved removing this entry from config: EDIT: the problem persists and causes HA reboot due to high RAM usage. At the moment I have uninstalled go2rtc add-on and I'm trying to use only WebRTC Camera custom component |
this is my configuration for streams part :
|
go2rtc version=1.9.4 platform=linux/amd64 revision=a4885c2 go2rtc.yaml:
|
My actual "solution" in an automation that restart go2rtc addon when it use more than 20% of RAM |
@pico1881 alias: Restart Frigate/go2rtc when memory leak is detected
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.memory_use_percent #<- adjust this to your setup
for:
hours: 0
minutes: 0
seconds: 1
attribute: value
above: 60 #<- adjust this to your setup
conditions: []
actions:
- action: hassio.addon_restart
data:
addon: ccab4aaf_frigate
mode: single |
this is my automation:
|
The memory usage sensor already exist for every addon, but are disabled. You have ti search go2rtc memory use percent on disabled entity and enable it |
The memory sensor Is available with go2rtc addon, not using custom component |
The issue depends on the environment. Possibly on cameras, models and their firmwares. Possibly on problems at the network level. I can't get anything like this on my two dozen test streams. |
So what can we do to help fix that? |
The first step to fixing any problem is to repeat it. Need to understand exactly what is causing the problem. Ideally, run go2rtc on a separate home PC. Only with one stream of a certain type. And make sure that it is this stream that is causing the problem. I've heard a similar claim about an RTMP stream from a Reolink camera. I will try to replicate it on my camera. But I see above that this occurs with the RTSP stream as well. |
@TekFan Thanks. Very helpful. Have to repeat the situation when the stream doesn't close. This is definitely a issue. It shouldn't be. |
No worries. Btw, I feel your pain, I've tried to reproduce this issue on my staging system and couldn't until yesterday where it happened for the first time in 2 weeks. Now, I could get the info from a stuck stream in the debug console and I'm a bit puzzled by the "Childs" list which is significantly longer than a normal stream. |
What stands out to me from that
Seems to be the same issue with Reolink audio #1254 possibly fixed by #1431 I can test #1431 with one of my Reolink locations to see if it resolves the issue. This is the same issue I run into with Reolink, it tries to close an already dead/closed audio child, hangs on the line in #1254. My fix in #1254 causes go2rtc to crash instead so it restarts itself. Hopefully #1431 fixes the issue cleanly |
Wow, because the first issue I noticed was the memory leak, I found this thread and didn't bother to look further since. |
|
@seydx Sorry, was out for a few days. |
scroll down and downlaod the right artefact and replace your go2rtc file |
I had already figured that out, but then where is located this file I have to replace with the one I have downloaded. |
No. Significant fixes should be carefully reviewed. |
For a few days I have encountered the unexpected restart of Home Assistant, after some analysis I found that the problem was due to excessive use of RAM above 90%. After further analysis I saw that the RAM was being used by go2rtc (see screenshot), but I don't see any errors in the log.
After manually restart of go2rtc addon the RAM usage is about 2-5%
The text was updated successfully, but these errors were encountered: