summaryrefslogtreecommitdiffstats
path: root/docs/content/usage/widgets/memory.md
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2021-07-17 21:25:05 -0400
committerGitHub <noreply@github.com>2021-07-17 21:25:05 -0400
commit7f24e6286735abcee6c3137dd9c22a7a178740a3 (patch)
tree0c47ab7f10e8f21018ef703f2e8f449bde222c0d /docs/content/usage/widgets/memory.md
parent4e07a28e172f0767edbb9d508f4fa9e2af7b25cd (diff)
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.
Diffstat (limited to 'docs/content/usage/widgets/memory.md')
-rw-r--r--docs/content/usage/widgets/memory.md10
1 files changed, 10 insertions, 0 deletions
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).