-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
[BUG] Possible memory leak with Obico ffmpeg
video streaming
#217
Comments
Sorry I have been really busy post-Thanksgiving. This sounds like a pretty bad problem. However I haven't been able to reproduce it. I notice you are using RTSP stream provided by OctoPrint's new webcam streaming stack. Can you disable it (do the opposite of https://community.octoprint.org/t/got-rtsp-on-octopi-working/54091), restart the Pi, and see if ffmpeg will still have memory leak? Also do you remember if this problem has always been there, or it started happening at some point? If the latter, do you remember if there was any change to your setup right before this started to happen? |
Oh I'm 99% sure the datachannel false alarms in the log file doesn't have to do with this issue. That was an annoying false alarm in Janus, another 3rd-party software that we don't have much control over... :( |
Sorry for the delay... Regarding your other question I cant recall exactly any particular change...this is something i've been tracking for a while (lets say, 6 months max?), because my OctoPrint instance was getting very unstable and I finally started the debug process to find the culprit. Ever since I created a cronjob watchdog that kills the ffmpeg process every time it reaches 30% memory, the system has been rock solid stable. |
It sounds like the issue has been going on for a while now. I guess you were using the octopi 1.0 SD card image? If so, have you done system upgrade? I'm wondering if it's possible that a system lib was upgraded to a version that causes the memory leak. |
I've been struggling with an instability issue on my OctoPrint instance, where, from time to time, the system runs out of memory. After some debugging, I managed to isolate the issue to the Obico plugin, specifically the
ffmpeg
process.It seems that when I have the streaming enabled (which is the purpose of Obico), the
ffmpeg
process is automatically spawned and slowly consumes memory until OctoPrint crashes due to out-of-memory issues.This process takes a few days before memory pressure starts causing instability in the entire system, eventually leading to OctoPrint crashing and failing the print.
I isolated this issue by letting the system run for some time with and without the Obico plugin enabled, which led me to open this issue.
To mitigate this problem, I set up a cron job to kill the
ffmpeg
process every day.To Reproduce
Steps to reproduce the behavior:
ffmpeg
process and check the memory it is consuming.ffmpeg
process and notice the sudden increase in memory. Depending on the interval, you may already be experiencing swapping problems due to a lack of available memory.ffmpeg
process, OctoPrint will eventually crash.Screenshots
Day 0 - Enabled Obico streaming -
ffmpeg
is consuming almost 4% of memory, which is fine.Day 1 - After 27 hours, the
ffmpeg
process is already taking up almost 30% of memory.Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: