Difference in memory usage CLI tools vs LuCI

How does LuCI calculate the "total available" and "used" values? I am finding that they differ from the output of some CLI tools on my x86/64 box:

# free -h   
              total        used        free      shared  buff/cache   available
Mem:           15Gi       1.2Gi       9.9Gi       455Mi       4.0Gi        13Gi
Swap:            0B          0B          0B

I guess it is the sum of used and buff/cache?

Which is inconsistent with htop:

# htop
Mem[||||||||||||||           1.19G/15.1G]

https://forum.openwrt.org/t/luci-total-memory-available/119922
This is a pretty common occurring question so if you search for it you can pick your favorite answer.

2 Likes