18

The output of the top command shows that 29GB of memory is used by "buff/cache". What does it mean and how I can free it? It is near to 90% of memory.

enter image description here

3

1 Answer 1

37

You don't need to free "buff/cache".

"buff/cache" is memory that Linux uses for disk caching, and that will be freed whenever applications require it. So you don't have to worry if a large amount is being shown in this field, as it doesn't count as "used" memory.

Quoted from http://www.linuxatemyram.com (emphasis mine):

Both you and Linux agree that memory taken by applications is "used", while memory that isn't used for anything is "free".

But how do you count memory that is currently used for something, but can still be made available to applications?

You might count that memory as "free" and/or "available". Linux instead counts it as "used", but also "available". (...) This "something" is (roughly) what top and free calls "buffers" and "cached". Since your and Linux's terminology differs, you might think you are low on ram when you're not.

3
  • 2
    Thank you for the clarification.
    – Player1
    Commented Jun 9, 2020 at 17:23
  • 2
    i got a problem with WSL2 linux, it is cache in wsl linux, but it's the real amount of RAM that windows allocated for
    – Dan D.
    Commented Jun 14, 2020 at 9:54
  • So.. only check Used and compare it with Total?
    – Neeraj
    Commented Jun 1, 2023 at 16:02

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