Cache within Kodi - Why does RAM need to be three times cache size?

  • Hi,

    my questing is more Kodi than LibreElec specific I believe, I still hope you can help me here.

    Can someone tell me why Kodi needs three times the amount of the specified cache size for RAM when caching videos?

    Does Kodi cache the videos already decoded?

    Thanks!

    • Official Post

    In my testing/playing I've not seen this 3 times element to actually happen. What I set and what my memory allocation is, is nowhere near the 3x reported (Mind you this has only been on RPi and Cubox-i so other distros might be different).

    I've a feeling that this figure is archaic, from a time long ago but is not valid with current Kodi releases. I set my cache to 1G on my cubox with only 2G memory and it worked fine.

    As chewitt mentioned, and from my own experiments, the default settings are fine, but you can "tweak" it slightly but don't expect a "magic button" from editing it.

  • Thanks for your response!

    I watch media files that sometimes (for single scenes) have peak bitrates high above average and for which my network does not have efficient performance. I was hoping to increase cachesize to an amount, so that I can avoid buffering during these scenes.

    • Official Post

    Depending on you HW and amount of free RAM available. Example for 1G of RAM.

    In .storage/.kodi/userdata/advancedsettings.xml

    Code
    <advancedsettings>
      <cache>
        <buffermode>1</buffermode>
        <memorysize>139460608</memorysize>
        <readfactor>20</readfactor>
      </cache>
    </advancedsettings>

    memorysize and readfactor can be increased, but will have possible other issues. Try increasing a bit at a time.