Project

General

Profile

[SOLVED] Memory leak in Kodi 17 on Ubuntu

Added by Jonathan Holvey almost 7 years ago

Hi,

Since upgrading Tvheadend from version 4.0 to 4.2 I've been experiencing a crash in Kodi after an hour or so of live TV through Tvheadend. It took me a while, but I've traced this to a memory leak in Kodi when running on Ubuntu.

I've posted to the Kodi PVR forum section, but so far I haven't been able to resolve the issue.

What steps can I take to determine if this is an issue with my system, or a Kodi bug?

This is what I know so far:
  • My Tvheadend server is running version 4.2.3 on Ubuntu 16.04.3 with kernel 4.4.0, as is my main Kodi install
  • All Kodi instances are version 17.6, and the HTS client Kodi addon is version 3.4.27
  • Kodi running on another Ubuntu 16.04.3 computer (but with kernel 4.10.0) also leaks memory in the same way, at about 40 MB per minute
  • Kodi running on Windows 7 is fine, even when the server runs out of memory
  • Both Kodi on Ubuntu and Tvheadend report dropped packets in their log files just before the memory is exhausted
  • A clean Kodi install/config on Ubuntu doesn't help
  • A clean Tvheadend config doesn't help
  • My tuner is a BGT3620 using drivers built from here. I've ordered a TBS6281SE to replace it, but it hasn't arrived yet
  • I only have one DVB-T2 tuner enabled in Tvheadend

Here's a log from Kodi on Ubuntu https://pastebin.com/YA5BUuFX
Here's part of a log from Tvheadend https://pastebin.com/k8pkL12L
Here's my thread on the Kodi forum. Sorry it's a bit long-winded https://forum.kodi.tv/showthread.php?tid=322181
Attached is a copy of my Tvheadend config

What should I do next?

tvheadend.zip (785 KB) tvheadend.zip Tvheadend config

Replies (6)

RE: Memory leak in Kodi 17 on Ubuntu - Added by Mark Clarkstone almost 7 years ago

Have you tried turning off hardware decoding in Kodi?

RE: Memory leak in Kodi 17 on Ubuntu - Added by Jonathan Holvey almost 7 years ago

Thanks Mark! Disabling hardware decoding in Kodi stops the memory leak. However, my CPU isn't up to the task of decoding HD streams.

What could be the cause? Maybe a graphics driver issue? I'm just using the generic Radeon driver that comes bundled with Ubuntu.

RE: Memory leak in Kodi 17 on Ubuntu - Added by Mark Clarkstone almost 7 years ago

Jonathan Holvey wrote:

Thanks Mark! Disabling hardware decoding in Kodi stops the memory leak. However, my CPU isn't up to the task of decoding HD streams.

What could be the cause? Maybe a graphics driver issue? I'm just using the generic Radeon driver that comes bundled with Ubuntu.

Quite possibly. You could give this ppa a try to see if that helps.

Let us know how to get on.

RE: Memory leak in Kodi 17 on Ubuntu - Added by Jonathan Holvey almost 7 years ago

Mark Clarkstone wrote:

You could give this ppa a try to see if that helps.

I tried installing the Open Graphics Drivers from the PPA you linked, but they have an issue as well. On both my main server and my test laptop, Kodi will crash after a minute or so of live TV playback. I've reverted to the default Ubuntu drivers for now.

My new TBS6281SE tuner arrived and is working correctly. It seems that Kodi's baseline memory usage has reduced, but it still creeps up over time.

RE: Memory leak in Kodi 17 on Ubuntu - Added by Jonathan Holvey almost 7 years ago

Team-Kodi member fritsch suggested on the Kodi forum that I should 'upgrade mesa'. A bit of googling lead me to an official PPA called ubuntu-x-swat/updates, which provides backports of drivers and libraries from later Ubuntu releases.

Upgrading from this seems to have fixed the problem I was seeing.

RE: Memory leak in Kodi 17 on Ubuntu - Added by Mark Clarkstone almost 7 years ago

Jonathan Holvey wrote:

Team-Kodi member fritsch suggested on the Kodi forum that I should 'upgrade mesa'. A bit of googling lead me to an official PPA called ubuntu-x-swat/updates, which provides backports of drivers and libraries from later Ubuntu releases.

Upgrading from this seems to have fixed the problem I was seeing.

Glad to hear you finally got to the bottom of this, marking as solved.

    (1-6/6)