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.
-
8Please [don't post pictures of text](https://unix.meta.stackexchange.com/q/4086/100397). – roaima May 28 '19 at 10:53
-
Related: [How do you empty the buffers and cache on a Linux system?](https://unix.stackexchange.com/q/87908/315749) – fra-san May 28 '19 at 10:54
-
Have you read https://linuxatemyram.com ? If yes and you still have a problem, please edit to explain what problem you have, and show the output of `cat /proc/meminfo`. If that's not the case, please say so, and a short answer might be written, because I can't find any other question to mark this one as a duplicate of :-). – sourcejedi May 28 '19 at 11:01
1 Answers
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.
- 28,763
- 21
- 89
- 133
-
2
-
2i got a problem with WSL2 linux, it is cache in wsl linux, but it's the real amount of RAM that windows allocated for – Dee Jun 14 '20 at 09:54
-
1EXCEPTION: Note that ramfs is part of "buff/cache" so if you have some ramfs mounting points and use significant space in these you do need to keep an eye and "free it". And the only way to measure the space used by ramfs is using du on each mounting point since df doesn't keep count of that (this is what makes ramfs so fast). – FlorianB Dec 16 '20 at 18:09
-
