Byobu reports different memory usage than `free` does

Asked by Serrano Pereira on 2011-05-25

Ubuntu 10.10
$ byobu --version
Screen version 4.00.03jw4 (FAU) 2-May-06

Hello,

I don't understand why byobu reports different memory usage than `free` does. `free` gives the following output:

serrano@kano:~$ free -tm
             total used free shared buffers cached
Mem: 731 648 83 0 105 342
-/+ buffers/cache: 200 531
Swap: 733 0 733
Total: 1465 649 816

But Byobu reports the following memory info in the notification bar:

[Memory available, Memory used]
732MB, 27%

The 732MB comes close to the total memory, but it could as well be the Swap which is 0% in use. But the memory used, 27%, doesn't match any of the values returned by `free`. I come to the following percentages if I use the values returned by `free`:

Expected % used for memory + swap:
649/1465*100=44%

Expected % used for memory:
648/731*100=89%

So where is that 27% coming from?

Question information

Language:
English Edit question
Status:
Solved
For:
byobu Edit question
Assignee:
No assignee Edit question
Solved by:
Dustin Kirkland 
Solved:
2011-05-26
Last query:
2011-05-26
Last reply:
2011-05-25
Best Dustin Kirkland  (kirkland) said : #1

Hello, thanks for the question!

So the methodology used for calculated the amount of memory used is to
take 100 * the number of used buffers/cache and divide that by the sum
of the used and free buffers/cache.

So for your case above, thats: 100 * 200 / (200 + 531) =~ 27%

The -/+ buffers/cache line shows how much memory is used and free from
the perspective of the applications.

Hope that helps!

--
:-Dustin

Thanks for the clear explanation!

Thanks Dustin Kirkland, that solved my question.