Project

General

Profile

High memory use

Added by Edwin de Graaf about 9 years ago

I have been using Tvheadend for a week now, and I feel it is using a lot of memory.

egraaf@tvheadend:~$ ps auxww| grep tvh
hts 950 0.0 1.3 916612 27244 ? Ssl 17:08 0:06 tvheadend -f -u hts -g video

I use the testing repository (4.0.6-9~ga1170f9)

The DVB-C interface is HDhomerun, there is no encryption on the coax.

Yesterday the Tvheadend process was killed because the 1GB memory I assigned this VM was full. I have now given it 2GB, but this seems excessive.

Otherwise I am really happy with Tvheadend, and I feel the 4.06 release does better at detecting my muxes than 4.05. With 4.05 I used to have some muxes in FAIL state, and now they all show OK.

Please let me know if there is a way to reduce memory usage, or how we can find out why it uses so much.


Replies (4)

RE: High memory use - Added by Mark Clarkstone about 9 years ago

If you're doing transcoding then that is your answer, Tvheadend uses ffmpeg code & it has some memory leaks.

I don't do any transcoding & mine stays at about 115mb usage with 6 tuners.

29779 hts       20   0 1339.3m 114.7m   6.1m S   0.0  3.8  31:55.17 tvheadend

RE: High memory use - Added by Edwin de Graaf about 9 years ago

I use HTSP with the default profile to Kodi Tvheadend client, so I don't think I use transcoding. The DVR profile is set to "pass"

RE: High memory use - Added by Mark Clarkstone about 9 years ago

in that case please open a ticket along with valgrind output.

Run (as a superuser).

valgrind --leak-check=full --show-reachable=yes /usr/bin/tvheadend -c /home/hts/.hts/tvheadend.

Try not to make any changes while you're running Tvheadend under valgrind as a superuser as this may cause permission issues when running normally, you may want to make a backup of your config.

RE: High memory use - Added by Edwin de Graaf about 9 years ago

I ran it overnight from valgrind, but there was no output. So I don't suppose there is much point creating a ticket.

It just shows an initial message from valgrind, and then the regular Tvheadend output:

root@tvheadend:~# valgrind --leak-check=full --show-reachable=yes /usr/bin/tvheadend -c /home/hts/.hts/tvheadend [11/1982]
3007 Memcheck, a memory error detector
3007 Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
3007 Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
3007 Command: /usr/bin/tvheadend -c /home/hts/.hts/tvheadend
3007
2015-10-15 01:40:22.601 [ INFO] main: Log started
2015-10-15 01:40:23.152 [ INFO] config: loaded
2015-10-15 01:40:26.187 [ INFO] scanfile: DVB-T - loaded 43 regions with 729 networks
2015-10-15 01:40:26.190 [ INFO] scanfile: DVB-S - loaded 1 regions with 92 networks
2015-10-15 01:40:26.190 [ INFO] scanfile: DVB-C - loaded 17 regions with 52 networks
2015-10-15 01:40:26.192 [ INFO] scanfile: ATSC - loaded 2 regions with 14 networks
2015-10-15 01:40:26.765 [ INFO] linuxdvb: adapter added /dev/dvb/adapter3
2015-10-15 01:40:26.833 [ INFO] linuxdvb: adapter added /dev/dvb/adapter2
2015-10-15 01:40:26.880 [ INFO] linuxdvb: adapter added /dev/dvb/adapter1
2015-10-15 01:40:26.951 [ INFO] linuxdvb: adapter added /dev/dvb/adapter0
2015-10-15 01:40:27.444 [ INFO] tvhdhomerun: Found HDHomerun device 14105649 with 4 tuners
2015-10-15 01:40:27.461 [ INFO] tvheadend: Using Network type : DVB-C
2015-10-15 01:40:27.529 [ INFO] tvhdhomerun: Created frontend 14105649 tuner 0
2015-10-15 01:40:27.586 [ INFO] tvhdhomerun: Created frontend 14105649 tuner 1
2015-10-15 01:40:27.647 [ INFO] tvhdhomerun: Created frontend 14105649 tuner 2
2015-10-15 01:40:27.700 [ INFO] tvhdhomerun: Created frontend 14105649 tuner 3
2015-10-15 01:40:27.925 [ INFO] dvr: Creating new configuration ''
2015-10-15 01:40:28.080 [ INFO] epggrab: module eit created
2015-10-15 01:40:28.084 [ INFO] epggrab: module uk_freesat created
2015-10-15 01:40:28.084 [ INFO] epggrab: module uk_freeview created
2015-10-15 01:40:28.085 [ INFO] epggrab: module viasat_baltic created
2015-10-15 01:40:28.175 [ INFO] epggrab: module opentv-ausat created
2015-10-15 01:40:28.250 [ INFO] epggrab: module opentv-skynz created
2015-10-15 01:40:28.251 [ INFO] epggrab: module opentv-skyuk created
2015-10-15 01:40:28.253 [ INFO] epggrab: module opentv-skyit created
2015-10-15 01:40:28.302 [ INFO] epggrab: module pyepg created
2015-10-15 01:40:28.304 [ INFO] epggrab: module xmltv created
2015-10-15 01:40:29.815 [ INFO] spawn: Executing "/usr/bin/tv_grab_nl"
2015-10-15 01:40:30.406 [ INFO] epggrab: module /usr/bin/tv_grab_nl created
2015-10-15 01:40:30.476 [ INFO] /usr/bin/tv_grab_nl: grab /usr/bin/tv_grab_nl
2015-10-15 01:40:30.498 [ INFO] spawn: Executing "/usr/bin/tv_grab_nl"
2015-10-15 01:40:32.142 [ INFO] epgdb: loaded v2
2015-10-15 01:40:32.143 [ INFO] epgdb: config 1
2015-10-15 01:40:32.144 [ INFO] epgdb: channels 0
2015-10-15 01:40:32.144 [ INFO] epgdb: brands 0
2015-10-15 01:40:32.145 [ INFO] epgdb: seasons 0
2015-10-15 01:40:32.146 [ INFO] epgdb: episodes 2938
2015-10-15 01:40:32.146 [ INFO] epgdb: broadcasts 2937
2015-10-15 01:40:33.063 [ NOTICE] START: HTS Tvheadend version 4.0.6-9~ga1170f9 started, running as PID:3007 UID:0 GID:0, CWD:/home/egraaf CNF:/home/hts/.hts/tvheadend
2015-10-15 02:21:32.871 [ INFO] /usr/bin/tv_grab_nl: grab took 2462 seconds
2015-10-15 02:21:33.365 [ INFO] /usr/bin/tv_grab_nl: parse took 1 seconds
2015-10-15 02:21:33.366 [ INFO] /usr/bin/tv_grab_nl: channels tot= 10 new= 0 mod= 5
2015-10-15 02:21:33.366 [ INFO] /usr/bin/tv_grab_nl: brands tot= 0 new= 0 mod= 0
2015-10-15 02:21:33.367 [ INFO] /usr/bin/tv_grab_nl: seasons tot= 0 new= 0 mod= 0
2015-10-15 02:21:33.367 [ INFO] /usr/bin/tv_grab_nl: episodes tot= 2925 new= 480 mod= 532
2015-10-15 02:21:33.368 [ INFO] /usr/bin/tv_grab_nl: broadcasts tot= 2925 new= 0 mod= 5

    (1-4/4)