Out of memory killing tvheadend Pi 3B+/4B

  • Ok I have gone through many issues in the past months but I have almost solved all of em.

    So I have a Pi 3B+ as Tvheadend Server

    So Pi 3b+ with HDHomeRun connected directly to ethernet (2 channel can run simultaneously at max 18-19mbit/s so lets round up at 40mbit/s)

    Added a wifi usb dongle cause onboard wifi keept crashing. Connected to usb hub and tvheadend client constantly pulling a channel from server.

    External Seagate HDD connected to usb hub also.

    I've read that ethernet/usb share the same channel so it could be limitation issue.

    As of right now I think I may have to get something with USB 3.0 to replace my Pi 3B+ (I was thinking a Rock Pi 4) but I would like to be able to monitor or see the exact MBit/s geeing processed on usb and ethernet at the same time while recording/timeshifting etc.

    Any way I can do that in LibreElec with putty?


    Edited once, last by majoly ().

  • I'm not too sure what the title has to do with this thread - can you change it so that it reflects the problem you are having.

    Install network tool and system tools from the LE repository and reboot.

    Use IFTOP to monitor the network.

    Use NMON or HTOP to monitor I/O

    Or just use NMON to monitor both.

    You can also install a docker container called NETDATA Here which will allow a full system monitor from a web browser.

  • Sorry for the title I changed it.

    Also realized that I may be in the wrong section, sorry again :(.

    I will try these commands thanks.

    Ill reply the results shortly

  • I've been using a RPi3B+ with RPi TV HAT booting off of a SSD as boot and storage without any issues, The max I could get was 3 simultaneous HD downloads on the same MUX. (A few errors but acceptable).

    I would look as the USB as a bottleneck as this will be processing ethernet, file I/O, Wifi and TV Tuner. You could also be having power issues,

    Please provide the URL from



    Please provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem.

    Full logs only. No modified logs.

    Do not post your logs directly into the forum, use pastebin.com and post the link.
  • Here is the pastebin of the logs.

    Crash occured a bit before 17:17 I think.

    When I went on the display, everything was frozen, coudnt do anything but reboot.

    I had 2 putty opened while it crashed. I attach the printscreen of both before I lost connection

    Thanks in advance for the awesome support

  • Ok problem that I saw at 17:17 i think did not leave any traces.

    The problem I have most of the time just happened at 19:04.

    This time It wasen't frozen so I was able to get some printing.

    EDIT : I forgot to mention, when the problem occured, no recordings were going on.

    Only watching a channel and nothing else happening on the PI. Timeshift is active.

    Edited once, last by majoly ().

  • Out of memory killing tvheadend thats the message ive been getting often. One thing weird ia it happens always around the same times at a specific channel.

  • Anyone have an idea on what I could try?

    Is it a bug?

    Do I need to get a better hardware to replace my 3b+

  • I have a Pi 3 with a TV hat here, and I'm seeing regular TVHeadend crashes.

    USB disk attached, using LibreElec as a PVR.

    I get crashes virtually always when I schedule a recording, sometimes before the recording is due to start, sometimes after, but never when none is scheduled.



  • I would say my setup is 95% reliable and most of my recordings are working if I am not watching something else at the same time.

    Since the message I got said it ran out of memory, ill try to first disable timeshift and see if it is more stable.

    If it becomes more reliable, then I guess I could blame the Pi3b+ having not enough RAM perhaps?

    If it is the case, any hardware you guys could recommend to replace my b+ that is around the same price and reliable?

    Rock Pi 4? Odroid? anything else?


  • I have disabled timeshift since then and I did not get that crash again.

    Hard to say if memory was the issue but stability is back with that option at off.

    Now I would love to get it back on but I guess I need an upgrade.

    Any recommendations? I think I would need at least 2gb of ram and usb3 would be a plus

  • A question.


    If I lower this value, would it help?

    Is it a bad idea to lower the gpu_mem?

    Edited 3 times, last by majoly ().

  • Little update.

    Since everything I was asked to try failed, i decided to try a Raspberry Pi 4 4GB version in hope there really is a memory issue and that it will solve it.

    Sadly the issue is still present even with 4gb of ram.

    Before the problem occured, the memory was steady high at 3.5gig of ram free in average and when the problem started occuring, I was able to see the memory going down rapidly to 90mbit until it crashed again. It went from 3.5gig to 90m in about a minute.

    From this point I guess it really its a memory leak going on with tvheadend.

    I have found similar post about this but could not get any resolution.

  • Try to add this to /storage/.kodi/addons/service.tvheadend42/bin/tvheadend42.start, below the . /etc/profile line:

    export MALLOC_ARENA_MAX=1
    export MALLOC_MMAP_THRESHOLD_=131072