Oom-killer killing kodi repeatedly, after a while

Have been looking forward to Kodi 18 in case it fixed this problem, but my wife’s starting to get annoyed…
My old kodi box (Chromebox 2955U with openelec on kubuntu) used to work for months at a time, suspending between uses. My Vero 4K+ stays on all the time, but after a while, I get a sad face, I think as kodi gets killed by the oom-killer (out of memory) - presumably because it’s the biggest memory user. This seems likely to happen when rescanning movies, or scrolling through them. Tonight, it happened repeatedly as I tried to rescan files, so I enabled debug and caught it in the act. Eventually it did manage to scan all files (so removing weird characters from filenames, that I hoped could be the issue, probably wasn’t helping).

I’m primarily after some suggestions about where to look. I suspected an addon - is there any way to see the memory usage of addons? I’m not finding them in ‘top’ or ‘ps’.
Perhaps I could make a cron job to reboot the 4K+ every… night, or week etc - but finding the real problem would of course be better.

Logs here (with lines identifying my files removed) - sorry if they’re big, but as I say, the problem doesn’t happen immediately after reboot.

Thanks for any suggestions!

I would suspect add-ons to be the culprit. You could try disabling them and enabling them gradually


Thanks Sam. Shame they’re not separate processes like Chrome etc’s tabs - would be great to be able to follow their memory/cpu usage. I’ll have a go disabling some - though thinking about it - given kodi gets killed and restarted, but still crashed (got killed) again quickly - should that be pointing to something external to kodi that persists across kodi restarts? Only, nothing uses anything close to the memory that kodi does of course. Curious…

They run in different threads.

Doubtful – have you installed other packages on your system?


That’s a start I guess - but when I enabled threads in standard top, they all show the same memory usage and command line so I can’t identify them. Perhaps there’s a better top out there. Ah - htop (with ‘Show custom thread names’) is a bit better - but memory usage is still that of the process, not the thread.

Other packages - yes - but nothing too crazy? rsync vim iotop iftop strace screen tcpdump ncdu logrotate gawk etc - oh - and gitk which did pull in X packages… but… basically just linux tools. The only consistent extra task the box has is running a python script every 5 minutes (via cron) to download data from my solar inverter.

Does disabling all add-ons (temporarily) resolve the issue?

Let’s see. Update Movie Library - crashed in about 5 seconds. (I’ll enable debug logs now…)
I’m using the Black Glass Nova skin - which won’t let me disable AutoCompletion for virtual keyboard.
Trying to disable a YouTube plugin froze the GUI. To avoid rebooting (which would fix things for a while) I killed the child kodi process. Most addons disabled (left the languge ones, and those authored by Team Kodi) Black Glass Nova still enabled. Update Movie Library: crashed in maybe 7 seconds.

Change to OSMC skin, disabled Black Glass Nova, and AutoCompletion. Update Movie Library: success. Scroll through movies quickly - also ok - that has often caused problems before.

So - sounds like it might be the Black Glass Nova skin - I’ll stick with OSMC skin for a while and see how I go. Just in case, here’s logs including the last crash with BGN https://paste.osmc.tv/umuhowacok