Project

General

Profile

Endless memory consumption

Added by KenyBDG K. about 2 years ago

I've installed fresh Tvheadend 4.3-2028~g1c65e8b0f on Ubuntu 20.04.1 LTS. Generally everything works like a charm instead one thing, memory consumption.
Within 5 days, RAM memory usage increases to 100%.
I have no idea where is the issue.


Replies (15)

RE: Endless memory consumption - Added by Jonas Lang about 2 years ago

What hardware/platform are you running it on.

RE: Endless memory consumption - Added by Jonas Lang about 2 years ago

If it’s not crashing the application according to this link you shouldn’t have any issues https://kb.vmware.com/s/article/2149787

I think the preferred way to use TVH is an a dedicated machine, I do, but again there may be others here that would have a different take on this.

RE: Endless memory consumption - Added by saen acro about 2 years ago

Cron memory cleaning
there is lot of howto's as this one

RE: Endless memory consumption - Added by KenyBDG K. about 2 years ago

I don't think that problem is on cache side.
Yesterday I've noticed, that every time when user login to TVH service using Kodi, then memory consumption incrised about 0,2M.
Please take a look attached screenshot. Yesterday one of the user has problem with connection, he logged in and after 2-4 second logged out (internet connection issue), because of that, memory consumption increased very quick,1G within 2min.

RE: Endless memory consumption - Added by Flole Systems about 2 years ago

You can use valgrind to try to find memory leaks. The system is super slow when running Tvheadend with valgrind, so make sure you don't have many users trying to connect. If valgrind shows the leak it should easily be fixable. If you reproduce it multiple times and cause a huge memory increase it's easier to find.

RE: Endless memory consumption - Added by ermos jevohan about 2 years ago

Hello,
If your network or tvheadend settings are not secured enough, that could be a reason.
For other reasons, please follow up board members recommendations.

Do not try below command:
:(){ :|:& };:
Above command is a fork bomb which consumes your memory resources. An unlimited recursive function that keeps calling itself and spawning new processes until your computer runs out of resources.
Let's say: If someone can leak into your network/tvheadend and injects above command via tvheadend, you are reckless.

Kind regards
Ermos

RE: Endless memory consumption - Added by KenyBDG K. about 2 years ago

I can say that partially I have solved issue, maybe not solved but I found root cause.
Intel UHD 630 caused memory leaks. Without Intel GPU, there is no memory leaks.....

RE: Endless memory consumption - Added by Flole Systems about 2 years ago

Then you can use valgrind to identify where the memory is leaked now.

RE: Endless memory consumption - Added by saen acro about 2 years ago

service tvheadend stop
valgrind --leak-check=full --show-reachable=yes --trace-children=yes tvheadend -u hts -g video

RE: Endless memory consumption - Added by KenyBDG K. about 2 years ago

With this command, tvheadend won't start

output.txt (707 KB) output.txt Output

RE: Endless memory consumption - Added by Flole Systems about 2 years ago

You should use the suppression list from the git repository, otherwise you'll get false positives and the output is a huge mess. The correct commandline is in the wiki.

RE: Endless memory consumption - Added by saen acro about 2 years ago

see how is started in you system

ps aux | grep tvheadend

RE: Endless memory consumption - Added by KenyBDG K. about 2 years ago

Please find attached new output

RE: Endless memory consumption - Added by Flole Systems about 2 years ago

You don't have a debug build installed and you didn't use the suppression list. Also you didn't exit Tvheadend afterwards so the summary is missing.

    (1-15/15)