Open ferre111 opened 12 months ago
top
, free
, and btop
use the "MemTotal - MemAvailable" approach, at least on Linux.
htop
is an outlier with this.
https://gitlab.com/procps-ng/procps/-/blob/master/library/meminfo.c?ref_type=heads#L724 https://gitlab.com/procps-ng/procps/-/blob/master/man/free.1?ref_type=heads#L32 https://gitlab.com/procps-ng/procps/-/blob/master/man/top.1?ref_type=heads#L584 https://github.com/aristocratos/btop/blob/d1680735d9329884c2d46f545a36df32ca5e40cf/src/linux/btop_collect.cpp#L1721
Due to this issue, the
MemAvailable
metric was used to calculate the used memory on Linux platforms. However, this decision was later reversed after a discussion in this issue. If I understand correctly, the primary argument for this reversal was to align the calculation of used memory with that of theprocps
tools. But now these tools use the method mentioned in the first issue. So I would like to ask if there is any more reason whyMemAvailable
is not use to calculate used memory?