Improve Memory Used counter

Bug #1806293 reported by Thorsten Kampe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
New
Undecided
Unassigned

Bug Description

There are different ways to calculate used memory on Linux:

1. the one that Byobu uses: MemUsed = MemTotal - MemFree - Cached - Buffers

2. the newer one[1]: MemUsed = MemTotal - MemAvailable

3. the one that `htop` uses: MemUsed = MemTotal - MemFree - Cached - Buffers - SReclaimable + Shmem

Since 2. and maybe 3. seem to be more realistic than 1., would you be willing to reconsider the algorithm to calculate memory used?

The different algorithms make a significant difference, for instance on my Ubuntu 18.10 VM, Byobu shows 65% memory used, htop show 61% memory used and MemAvailable points to 70% memory used.

[1] man page of `free`: "available: Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.