Project

General

Profile

Possible Tvheadend Memory Leak

Added by Trevor Michel-Smith almost 13 years ago

Available memory leaks away slowly on my media center when viewing live TV via Tvheadend and either XBMC or Showtime.

I have an AMD64 dual-core media PC with 2G RAM, Ubuntu 10.04, TVHeadEnd, XBMC and Showtime. The memory leak occurs only when watching live TV. It may happen too when Tvheadend is recording a live stream. The leak happens at a rate of 100k every few seconds (while watching a DVB-S SD live stream)...roughly.

My version of Tvheadend is git-f174257. I have the same issue on older versions going back to Nov/Dec 2011.

I tested for this memory leak while using XBMC or Showtime as the front-end and it happens with both. If I can figure out how to get VLC to work with Tvheadend, I'll try that too. I use "top" to show the system's memory usage and monitor for the leak.

Once all my memory is used either Tvheadend or XBMC give up and stop working properly. I have to restart my PC to get the memory back. If TVheadend is terminated, then the leak stops.

I wanted to know if anyone else has this problem.

Cheers,
Trevor.


Replies (10)

RE: Possible Tvheadend Memory Leak - Added by Mike Freeman almost 13 years ago

Not sure if this is due to the same thing, but I've noticed that if I'm watching TV for more than about an hour to hour and a half, the frame rate gradually begins to slow down and digital artifacting starts creeping in (random colored squares appear on the screen occasionally). If I leave it over night, the frame rate drops to 2 to 3 seconds per frame. This is fixed by stopping the stream and restarting it. Seems to me like it could be a memory leak issue, as well. This is on XBMC with tvheadend 2.12.99-git20111014.83c8467-odk1-maverick on Linux Mint 10.

RE: Possible Tvheadend Memory Leak - Added by Hein Rigolo almost 13 years ago

could you please test for this leak while only using tvheadend to record. So that we can know for sure that this is tvheadend related, or in the communication part to tvheadend (htsp protocol)

There is a pull request on github to fix a memory leak in htsp.c so this might be related.

Hein

RE: Possible Tvheadend Memory Leak - Added by Trevor Michel-Smith almost 13 years ago

Sure I'll do the test. I just need a day or two. Cheers, Trevor.

RE: Possible Tvheadend Memory Leak - Added by Jonatan Antoni almost 13 years ago

Hello,

I have a similar problem. The tvheadend thread comsumes up all the memory and dies.

The patch by mikrohard may hit the point. I didn't made it to run tvheadend with valgrind, yet. But I'll give that patch a try and report back.

.-jonatan

RE: Possible Tvheadend Memory Leak - Added by Zdeněk Kopřivík over 12 years ago

What is the status of the bug?

I'm using TVheadend from EricV tree (with TS streaming) and I'm also having problems with memory leaks. In my case it happens randomly while switching channels. It takes about 30 minutes from the begining of the leak to eat 1 GB RAM.

RE: Possible Tvheadend Memory Leak - Added by pierre cha about 12 years ago

Hello .
I'm also having problems with memory leaks.
test with several versions from git and tvheadend 3 => same problems.
with pc in WIFI the memory leak seems more important
Stopping the stream don't reinitialize totally the memory .
With record program , no problem .

RE: Possible Tvheadend Memory Leak - Added by Adam Sutton about 12 years ago

Pierre,

Can I just clarify a few points:

1. This only happens while streaming? (not local recording via TVH UI).
2. How are you streaming? HTTP or HTSP (XBMC).
3. Are you saying the memory leak appears worse when using WIFI? Have you compared to wired Ethernet?

Based on what I think your answers to those questions will be, it sounds like it might be a problem with HTSP (other?) streaming. If its related to something like dropped/queued packets then that might explain why things are worse with WIFI.

Regards
Adam

RE: Possible Tvheadend Memory Leak - Added by Zdeněk Kopřivík about 12 years ago

Hi,
I've also found something like a memory leak issue (https://www.lonelycoder.com/redmine/issues/1054).

Could be the same problem.

RE: Possible Tvheadend Memory Leak - Added by pierre cha about 12 years ago

Adam Sutton wrote:

Pierre,

Can I just clarify a few points:

1. This only happens while streaming? (not local recording via TVH UI).
2. How are you streaming? HTTP or HTSP (XBMC).
3. Are you saying the memory leak appears worse when using WIFI? Have you compared to wired Ethernet?

Based on what I think your answers to those questions will be, it sounds like it might be a problem with HTSP (other?) streaming. If its related to something like dropped/queued packets then that might explain why things are worse with WIFI.

Regards
Adam

hello Adam

i use only http with IPTV
I try some tests with htop
recording live and playing this records => no problem about memory leak
streaming live tv with Wifi the memory increase about 10Mo/mn and in wired ethernet about 500ko/mn
I don't see anything in syslog about dropped/queued packets but it seems be the problem.
can i see somewhere logs or compile tvheadend with more detailled logs ?

thanks

RE: Possible Tvheadend Memory Leak - Added by Adam Sutton about 12 years ago

Pierre,

On the basis of what you've said above I think this definitely sounds like a genuine bug and I'm thinking it could be related to discarded packets not being cleaned up.

Please can you submit this as a bug in the issues section and I or someone else will try and take a look.

You can enable debug by running with -d, however I'm not sure whether this will tell you anything useful in this case.

Adam

    (1-10/10)