Which one is the cache value in the output of top?

Pablo asked:

On the book I’m reading, DevOps Troubleshooting, it says that the last value in the swap line is the memory used for file caches (yellow) in Linux so subtracting it to the used memory (green) gives you the actual used RAM:

enter image description here

but when I run it on my machine, the output looks like it has a different format with buffer and cache now being on the same line:

enter image description here

Did the output of top change? Why is there a difference here?

I’m familiar with the concept of the Linux file cache, is buff/cache how much it’s being used for the file cache in the latter screenshot?

My answer:

The output format of top changed many years ago, in a major rewrite published in 2011, almost before DevOps was even a widely used term. It’s strange that your book would use such an ancient output, unless it too is ancient. Now, the actual memory available to applications is called out in its own field. The memory used for cache and buffers is combined here.

View the full question and any other answers on Server Fault.

Creative Commons License