tvheadend memory usage (channel stalling)
Added by Bruce McAlister almost 12 years ago
Hi All,
I have a strange issue occurring when recording an HD channel and watching another HD channel. I am able to reproduce this every time by initiating a recording of an HD channel then switching to another HD channel, then after approximately 5 minutes the channel I am watching stalls and I see the following in the log file:
Jan 6 20:20:25 tvheadend tvheadend[1045]: parser: transport stream H264, DTS discontinuity. DTS = 16059600, last = 10922400 Jan 6 20:20:25 tvheadend tvheadend[1045]: parser: transport stream AC3, DTS discontinuity. DTS = 15926211, last = 10825731 Jan 6 20:20:25 tvheadend tvheadend[1045]: parser: transport stream MPEG2AUDIO, DTS discontinuity. DTS = 15936689, last = 10826129
If I leave the channel I am watching it will then eventually come back to life just after the above message appears. The stall lasts for around a minute, then the above message is logged and then the channel plays properly again.
I tried changing the recording format from MKV to TS but the symptoms are the same.
I then has a look at how much memory tvheadend is using and I was amazed to see that it had a 2.5GB VSZ registered in ps output, see below:
# ps -e -opid,ppid,rss,vsz,comm,args | grep tvhead | grep -v grep 1045 1 580380 2428540 tvheadend tvheadend -f -u hts -g video
I then restarted tvheadend and on restart the process immediately allocated 1.5GB memory to itself:
# service tvheadend restart tvheadend stop/waiting tvheadend start/running, process 2635 # ps -e -opid,ppid,rss,vsz,comm,args | grep tvhead | grep -v grep 2635 1 55624 495916 tvheadend tvheadend -f -u hts -g video # ps -e -opid,ppid,rss,vsz,comm,args | grep tvhead | grep -v grep 2635 1 133584 1558984 tvheadend tvheadend -f -u hts -g video
The above is tested on an Ubuntu 12.04 LTS server ESX virtual machine, but the issue is reproduceable on a bare metal system running Ubuntu 12.04 LTS server with 8GB memory (I cannot test with the 8GB system anymore).
I installed tvheadend using the Adam Sutton PPA listed on the download page. The version is:
HTS Tvheadend 3.2.34~gfaee94b~precise
The system is configured with the following DVB-T/DVB-S2 tuners:
Hauppauge WinTV Nova-T-500 Digital Devices GmbH Octopus LE DVB adapter (Cine S2)
I am using OpenELEC 3 RC1 as the client to watch the channels with using the TVHeadend PVR client add-on. All systems are connected via 1Gb network.
I've read a couple threads in the forums relating to memory issues and seen a couple bug reports but it looks like they were fixed. I'm wondering if I have stumbled upon a new one or if this is normal for TVHE to pre-allocate this much memory
Any thoughts would be appreciated.
Thanks
Replies (2)
RE: tvheadend memory usage (channel stalling) - Added by Bruce McAlister almost 12 years ago
I just did a quick test with un-encrypted HD channels and the issue does not appear to occur. I am using the CWC within TVH, maybe this has something to do with it.
I'll need to do more testing to be sure it is only ocurring when I use the CWC.
Maybe I should try the CAPMT section, I've been reading that a lot of work has gone in to fixing issues with the CAPMT section, but the CWC (newcamd) code has been untouched for some time?
RE: tvheadend memory usage (channel stalling) - Added by Bruce McAlister almost 12 years ago
just tested with tvh version "HTS Tvheadend 3.3.268~gd18bd91" and it appears the same issue is occuring. I tested with CWC and CAPMT configurations. Service still stalls if recording an HD channel and watching another one :/