Kodi eating all my RAM
#1
I've been messing around with this for a few days and I'm out of ideas. 

I have been using Kodi 18.9 on my old install of Linux Mint 18.3. I have a rather large library but on that OS Kodi might use 40% of my ram and be stable there. 

I recently upgraded to 20.1 (Based on Ubuntu Focal) via a clean install to a new drive. I initially installed the flatpak version of Kodi (18.8) and just dragged over my folders (~/.kodi) from the old install, started it up and I was back in business with all my settings.

Quite quickly I noticed that RAM usage by kodi was constantly increasing. Even long after the library scan was done RAM usage increases until it has maxed out my 32GB and the system freezes. This happens in less than an hour. RAM usage constantly increases whether I am watching something or it is sitting idle. The rate of increase doesn't seem to slow. I use the Aeon MQ8 skin, a heavy one, I know, but have never had a problem with it. 

I uninstalled the flatpak version and upgraded to 18.9 via kodi PPA. Same result. I switched to Estuary, no change. I disabled all my addons (uninstalled some also), tried various kernels and this just keeps happening. In debug mode RAM usage shown there also increases such that last night, Kodi would show it is using 10 GB and glances/htop will show 21.5 GB usage. At this moment though Kodi is showing 12.5GB of usage but HTOP shows 10.3 GB of usage and increasing at about 10MB a second. (just before I post this Kodi is reporting usage of 7.6GB and falling while HTOP reports 14GB and increasing) *SHRUGS*

I have a bunch of media folders on my NAS mounted NFS. Another thing is that Kodi is constantly downloading data from my NAS at an average of about 2 MBytes a second, while sitting idle. It will do this all day.  The only thing the debug log is showing is pages and pages like this, showing this for all the shared folders:

Code:
2021-01-22 14:34:17.996 T:140463234529024   DEBUG: NFS: Refreshing context for 192.168.1.10/volume2/VS2, old: 3514218, new: 3514239
2021-01-22 14:34:17.996 T:140463234529024   DEBUG: NFS: Using cached context.
2021-01-22 14:34:17.998 T:140462291654400   DEBUG: NFS: Refreshing context for 192.168.1.10/volume1/Ms, old: 3514221, new: 3514241
2021-01-22 14:34:17.998 T:140462291654400   DEBUG: NFS: Using cached context.
 
Anybody have any ideas on how I can troubleshoot this further? I am out of ideas.

Tanx
Reply
#2
Are you running any non-standard plugins?  That is not normal.
Need help programming a Streamzap remote?
Reply
#3
Something similar to this perhaps? https://forum.kodi.tv/showthread.php?tid...emory+leak
Reply
#4
Well, I'm not sure what you mean by non-standard plugins. I use Kodi as a library manager and don't use plugins a bunch. The ones I have installed are almost all out of the Kodi repo and a few out of a couple of other repos that were listed in these forums, one for the skin, one for a different weather provider.. I have no banned third party plugins or repos.

I did try running Kodi with the variable suggested in that thread, but in that thread a dev popped in and wrote about how they had already included that in the code. Regardless it didn't work, RAM use still climbs.

I am curious if there is a connection between the repeating "NFS: refreshing context.." I posted from the debug log above and this ram usage I don't know what the refreshing context means, but the log fills with hundreds of thousands of lines of it.

Any other ideas?
Reply
#5
(2021-01-23, 05:34)yellow1144 Wrote: Any other ideas?
One suggestion I can give is to try doing the NFS mounts at OS level then have Kodi look at local dirs for its content, so the NFS side of things is no longer handled by Kodi.

Although this shouldn't be needed, (a) it should reduce your logfile growth, and (b) may help determine the cause if - after this change - you don't get increased RAM usage.

I honestly can't see why NFS polling should cause memory leaks, unless some cache isn't being refreshed but simply growing.  So perhaps this measure may help understand if it IS the case or not.
Reply
#6
(2021-01-23, 18:35)Preacher Wrote:
(2021-01-23, 05:34)yellow1144 Wrote: Any other ideas?
One suggestion I can give is to try doing the NFS mounts at OS level then have Kodi look at local dirs for its content, so the NFS side of things is no longer handled by Kodi.

Although this shouldn't be needed, (a) it should reduce your logfile growth, and (b) may help determine the cause if - after this change - you don't get increased RAM usage.

I honestly can't see why NFS polling should cause memory leaks, unless some cache isn't being refreshed but simply growing.  So perhaps this measure may help understand if it IS the case or not.

Thanks Preacher

All my NFS shares are already auto-mounted to local folders through fstab at boot, so...

I don't think the polling is causing the leak. I was really wondering if the polling is what is responsible for the avg 24 Mbps of constant download traffic from my server to Kodi at idle. I don't know the exact nature of the polling, how it works, but I do have a large library. Another machine I have does it too and no memory leaks. I'm still investigating plugins.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi eating all my RAM0