Forum
[SOLVED] Kodi using almost all the RAM. - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: [SOLVED] Kodi using almost all the RAM. (/thread-4041.html)

Pages: 1 2


Kodi using almost all the RAM. - Exnor - 22nd Aug, 2019 08:31 AM

Hi,
So i got a new "problem" that repeats itself every 3 weeks or so on a non stop Pi being on (btw i never shutdown my Pi 3B+ like i never did for my old Pi 1B for several years, unless its needed of course):

It starts using up RAM and goes up to 78%.... sometimes it reduces the usage back to 60% in hidle but even when i'm not using it the amount of RAM is somewhat too much (?).
Also stats show the average CPU usage is less than 8% even if i'm watching something so i think it's not "processing" anything extra.

When i was writing this:

Terminal

top - 23:19:03 up 18 days, 21:46, 1 user, load average: 0.21, 0.14, 0.10
Tasks: 135 total, 1 running, 67 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.3 us, 0.8 sy, 0.2 ni, 97.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 763424 total, 55136 free, 584660 used, 123628 buff/cache
KiB Swap: 381432 total, 302072 free, 79360 used. 82676 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2683 xbian 20 0 1035424 523064 21840 S 7.3 68.5 2029:06 kodi.bin
72 root 1 -19 0 0 0 S 0.7 0.0 130:48.26 vchiq-slot/0
25658 root 20 0 7240 2952 2416 R 0.7 0.4 0:01.94 top
3110 ntp 20 0 6928 2076 1812 S 0.3 0.3 23:40.38 ntpd
25575 root 20 0 9868 4840 4136 S 0.3 0.6 0:00.23 sshd
1 root 20 0 5684 2432 1748 S 0.0 0.3 0:22.71 init

As you can see, at idle is using 68% of the available RAM...

Then i stop/start Kodi and:

Terminal

top - 23:24:04 up 18 days, 21:52, 1 user, load average: 0.56, 0.23, 0.13
Tasks: 144 total, 1 running, 69 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.0 us, 0.8 sy, 0.1 ni, 98.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 763424 total, 504632 free, 105268 used, 153524 buff/cache
KiB Swap: 381432 total, 371192 free, 10240 used. 560892 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28113 xbian 20 0 488248 99628 43980 S 6.3 13.1 0:22.50 kodi.bin
72 root 1 -19 0 0 0 S 0.3 0.0 130:49.64 vchiq-slot/0
28805 root 20 0 7248 2788 2248 R 0.3 0.4 0:00.11 top
1 root 20 0 5684 2468 1748 S 0.0 0.3 0:23.34 init
2 root 20 0 0 0 0 S 0.0 0.0 0:01.24 kthreadd

Now its just using about 13%.

I only have a few plugins installed and since the CPU usage is so low (plus they were the same on the Pi 1 and never gave any problems) i don't suspect any of them...

Is this a normal thing now or is this a problem? So far the system as not crashed, but i restart Kodi every 2 to 3 weeks to "reset" memory usage.

Thanks.


RE: Kodi using almost all the RAM. - Nachteule - 22nd Aug, 2019 11:28 PM

Don't worry about that. It's the way how Kodi works.

Btw, there ist no difference to Pi1. After booting, I do have more then 200MB of free ram. After some days of usage, free ram goes down to 130MB. I noticed this behavior for many years.


RE: Kodi using almost all the RAM. - Exnor - 23rd Aug, 2019 02:39 AM

(22nd Aug, 2019 11:28 PM)Nachteule Wrote:  Don't worry about that. It's the way how Kodi works.

Btw, there ist no difference to Pi1. After booting, I do have more then 200MB of free ram. After some days of usage, free ram goes down to 130MB. I noticed this behavior for many years.

Yes i had the same behavior on my Pi 1, but that unit only had 512 MiB or RAM where 90 of them allocated to the GPU... This one has 1 GiB of RAM with 256 allocated to the GPU.

So Kodi "hogs" memory if its available?

Marked as Solved.


RE: Kodi using almost all the RAM. - Nachteule - 23rd Aug, 2019 06:26 AM

(23rd Aug, 2019 02:39 AM)Exnor Wrote:  
(22nd Aug, 2019 11:28 PM)Nachteule Wrote:  Don't worry about that. It's the way how Kodi works.

Btw, there ist no difference to Pi1. After booting, I do have more then 200MB of free ram. After some days of usage, free ram goes down to 130MB. I noticed this behavior for many years.

Yes i had the same behavior on my Pi 1, but that unit only had 512 MiB or RAM where 90 of them allocated to the GPU... This one has 1 GiB of RAM with 256 allocated to the GPU.

So Kodi "hogs" memory if its available?

Marked as Solved.

Yes, that's how linux kernel works in general and Kodi in particular


RE: Kodi using almost all the RAM. - Exnor - 24th Aug, 2019 03:20 AM

(22nd Aug, 2019 11:28 PM)Nachteule Wrote:  Yes, that's how linux kernel works in general and Kodi in particular

Ok thanks for the info Big Grin


RE: Kodi using almost all the RAM. - gkusiak - 15th Nov, 2019 12:05 PM

(24th Aug, 2019 03:20 AM)Exnor Wrote:  
(22nd Aug, 2019 11:28 PM)Nachteule Wrote:  Yes, that's how linux kernel works in general and Kodi in particular

Ok thanks for the info Big Grin

So a swap file is a good idea in general?

First post here...looking to build one of these over the weekend/next week.

thank you all


RE: Kodi using almost all the RAM. - Exnor - 16th Nov, 2019 04:35 AM

(15th Nov, 2019 12:05 PM)gkusiak Wrote:  
(24th Aug, 2019 03:20 AM)Exnor Wrote:  
(22nd Aug, 2019 11:28 PM)Nachteule Wrote:  Yes, that's how linux kernel works in general and Kodi in particular

Ok thanks for the info Big Grin

So a swap file is a good idea in general?

First post here...looking to build one of these over the weekend/next week.

thank you all

I really don't know.... By default it appears a swap partition is in use and i never bothered to disable it to see if had any impact on the performance ( since its on a flash memory unit it will consume write cycles and in theory reduce the lifespan... But my last SDCard was on 24/7 for 5years i think and it's still working so...).


RE: Kodi using almost all the RAM. - deHakkelaar - 16th Nov, 2019 04:42 AM

About Linux caching:

https://www.linuxatemyram.com/


Kodi using almost all the RAM. - gkusiak - 16th Nov, 2019 05:17 AM

That’s a good link. Thank you.
But to the concern of burning read/write cycles on a flash card, can the swap be made on another “drive” that’s more robust and less likely to fail?


Sent from my iPhone using Tapatalk


RE: Kodi using almost all the RAM. - deHakkelaar - 16th Nov, 2019 05:25 AM

I wouldn't be concerned about that.
All the SD cards I purchased for the many SBC's I owned or gave away are still alive except one.
And this one cheap SD card that broke was of unknown brand and source.


RE: Kodi using almost all the RAM. - Nachteule - 17th Nov, 2019 08:38 AM

(16th Nov, 2019 05:25 AM)deHakkelaar Wrote:  I wouldn't be concerned about that.
All the SD cards I purchased for the many SBC's I owned or gave away are still alive except one.
And this one cheap SD card that broke was of unknown brand and source.

Most of my Samsung sd-cards have died meanwhile Dodgy


RE: Kodi using almost all the RAM. - Exnor - 17th Nov, 2019 09:24 AM

(17th Nov, 2019 08:38 AM)Nachteule Wrote:  
(16th Nov, 2019 05:25 AM)deHakkelaar Wrote:  I wouldn't be concerned about that.
All the SD cards I purchased for the many SBC's I owned or gave away are still alive except one.
And this one cheap SD card that broke was of unknown brand and source.

Most of my Samsung sd-cards have died meanwhile Dodgy

My Sandisk is still alive and working after 5+ years Tongue


RE: Kodi using almost all the RAM. - deHakkelaar - 18th Nov, 2019 07:38 AM

(17th Nov, 2019 08:38 AM)Nachteule Wrote:  Most of my Samsung sd-cards have died meanwhile Dodgy

Good to know not to buy Samsung Wink
The cards are cheap enough to not do all the effort of having swap somewhere else or setup ramdisks etc and complicating your setup:

https://en.wikipedia.org/wiki/KISS_principle

If one should break, replace and restore backup is my credo.


Kodi using almost all the RAM. - gkusiak - 19th Nov, 2019 01:09 AM

One must have a good backup to restore from. I have never been particularly diligent about that, but habits can change.


Sent from my iPhone using Tapatalk


RE: Kodi using almost all the RAM. - deHakkelaar - 19th Nov, 2019 10:00 AM

You'll learn eventually how valuable a good backup can be.
I learned the hard way many times Wink