12

monitor

In the above menu, what does the difference between Mem and cache? Are they both use memory from my RAM? Which program use cache?

1 Answer 1

19

cache is where linux uses some of your RAM to keep a cache of data recently read from the disk.

It's a good thing. cache is as good as free RAM. No, it's better. free is wasted memory, it's RAM sitting there with zeroes or some other useless crap in it. cache is where you keep data recently read from the disk, where there would otherwise be useless garbage, in case the system wants to read that part of the disk again any time soon.

Whenever a process wants more memory, cache is given to it as readily as free. free is the money you spent on RAM being utterly useless, cache is Linux making some use of it (so long as nothing else wants it).

More info here: http://www.linuxatemyram.com/

4
  • So it's actually a good thing, what a relieve. Because sometime cache size is so big that it takes 75% of my small 2 Gb RAM. Thanks for your explanation.
    – Nur
    Jun 20, 2013 at 7:48
  • 4
    When system monitor reports 17 GiB out of 31 GiB used and that there are 12 GiB in cache, are those 12 GiB of cache counted in those 17 GiB of RAM used or not? (We're talking Ubuntu 20.04 here)
    – edison23
    Dec 17, 2020 at 13:59
  • 1
    @edison23 Based on my reading of /proc/meminfo I'm pretty sure cache is not counted in the "used" memory.
    – Jasper-M
    Apr 12, 2021 at 9:04
  • This is actually great when you use Ubuntu natively, but when you put it in a VM things can get ugly because you actually lose access to that RAM on the host machine. So it is effectively used memory in the perspective of the host machine.
    – Everyone
    Oct 15, 2022 at 22:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .