Ubuntu – way to set the (max) amount buffer / cache an Ubuntu server reserves from RAM

cacheram

I've recently upgraded my server's RAM to 16 GB. The server itself doesn't require much RAM but Ubuntu seems to reserve quite a bit for caching.

Doing free - m results in:

              total        used        free      shared  buff/cache   available
Mem:          15498        1811        7478          31        6208       13326
Swap:          3401           0        3401

It uses less than 2 GB while running for 2 months straight, but reserves 6 GB if I understand this correctly. I'm planning to run a Minecraft server on it as well which would require 8 GB RAM while there's only 7 GB "free".

Hence the question: Can I limit the amount being reserved for caching so there will be more free for me to use?

Best Answer

There is no real need to limit the amount of RAM used for caching, as this memory is only reserved for caching but will get used if your applications will need more RAM.

A good read might be found at https://www.linuxatemyram.com/ (I'm not affiliated with this site) It might clear up a bunch of insecurities and concerns on your side I hope.

As to how to limit the caching amount I lack the knowledge to give you there a profound answer, but the website I linked states that there is no way to limit the disk caching amount.

Related Question