From 7f24e6286735abcee6c3137dd9c22a7a178740a3 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Sat, 17 Jul 2021 21:25:05 -0400 Subject: bug: switch over to procfs for linux mem usage (#547) Swap to manually calculating the mem total and usage via procfs. The usage calculation is now: total - (free + cached + buffers + slab_reclaimable - shmem) This follows the same usage calculation as htop. See the PR for more details. --- docs/content/usage/widgets/memory.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/content/usage/widgets/memory.md') diff --git a/docs/content/usage/widgets/memory.md b/docs/content/usage/widgets/memory.md index f92f18a8..f25dbe36 100644 --- a/docs/content/usage/widgets/memory.md +++ b/docs/content/usage/widgets/memory.md @@ -28,3 +28,13 @@ Note that key bindings are generally case-sensitive. | Binding | Action | | ------------ | -------------------------------------------------------------- | | ++"Scroll"++ | Scrolling up or down zooms in or out of the graph respectively | + +## Calculations + +Memory usage is calculated using the following formula based on values from `/proc/meminfo` (based on [htop's implementation](https://github.com/htop-dev/htop/blob/976c6123f41492aaf613b9d172eef1842fb7b0a3/linux/LinuxProcessList.c#L1584)): + +``` +MemTotal - MemFree - Buffers - (Cached + SReclaimable - Shmem) +``` + +You can find more info on `/proc/meminfo` and its fields [here](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-proc-meminfo). -- cgit v1.2.3