0

I wanted to profile the memory usage of a script. Here's the output before it was running:

procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
0  0  15624 186660  39460 439052    0    0     0     2    1    1  0  0 100  0

Here's the output while the script is running, at the point where free memory was at its lowest value:

procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
0  0  15624  11464  40312 473524    0    0     0     2    1    1  0  0 100  0

So free memory dropped by about 175 MB, and I expected that buff would increase by that amount. But it seems the other columns changed by relatively negligible amounts - how is this possible? Am I interpreting this wrong, or is some memory just not being accounted for in this output?

jimbotron
  • 3
  • 1

1 Answers1

0

Some of the additional memory that is no longer free is being used as cache. We can't tell from just this information what the rest of the memory is being used for, but most likely it's kernel-level caches of things like filesystem metadata. So memory that was previously holding something that couldn't possibly be useful is now holding information that might be useful. So this shows things getting better.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84