0

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?

Pablo Fernandez
  • 7,438
  • 25
  • 71
  • 83

1 Answers1

1

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.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • 2011... wow... suddenly my trust in that book went down. Is 2153.5 the actual RAM available to apps in that screenshot? Why is it on the Swap line? – Pablo Fernandez Oct 03 '20 at 22:27
  • @Pablo Yes, it's the actual memory available to apps. And it's on that line because it wouldn't fit on the previous line. Notice that the entry before it has a full stop instead of a comma. – Michael Hampton Oct 03 '20 at 22:28
  • Ahhh... I didn't notice the full stop. Thank you. – Pablo Fernandez Oct 03 '20 at 22:33