mirror of
https://github.com/ClementTsang/bottom.git
synced 2026-07-11 06:57:08 +00:00
edc295e3ed
This change moves some options to a more appropriate section for the config file. This only deprecates the old options for now, so they're still valid, but we will remove them later (maybe after the next stable release, to give warning). One thing I want to do for the legend position options is maybe expand it, and now is the best time to do so, but for now I'm just copying it over verbatim. The deprecated options will also emit a warning to stderr. This PR also contains a driveby to alias `[network]` to `[network_graph]`.
52 lines
2.2 KiB
Markdown
52 lines
2.2 KiB
Markdown
# Memory Widget
|
|
|
|
The memory widget provides a visual representation of RAM and swap usage over time.
|
|
|
|
<figure>
|
|
<img src="../../../assets/screenshots/memory.webp" alt="A picture of an expanded memory widget."/>
|
|
</figure>
|
|
|
|
## Features
|
|
|
|
The legend displays the current usage in terms of percentage and actual usage in binary units (KiB, MiB, GiB, etc.).
|
|
If the total RAM or swap available is 0, then it is automatically hidden from the legend and graph.
|
|
|
|
One can also adjust the displayed time range through either the keyboard or mouse, with a range of 30s to 600s.
|
|
|
|
This widget can also be configured to display Nvidia and AMD GPU memory usage (`--disable_gpu` on Linux/Windows to disable) or cache memory usage (`--enable_cache_memory`).
|
|
|
|
## Key bindings
|
|
|
|
Note that key bindings are generally case-sensitive.
|
|
|
|
| Binding | Action |
|
|
| --------- | --------------------------------------- |
|
|
| ++plus++ | Zoom in on chart (decrease time range) |
|
|
| ++minus++ | Zoom out on chart (increase time range) |
|
|
| ++equal++ | Reset zoom |
|
|
|
|
## Mouse bindings
|
|
|
|
| Binding | Action |
|
|
| ------------ | -------------------------------------------------------------- |
|
|
| ++"Scroll"++ | Scrolling up or down zooms in or out of the graph respectively |
|
|
|
|
## How are memory values determined?
|
|
|
|
### Linux
|
|
|
|
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).
|
|
|
|
### Windows
|
|
|
|
In Windows, we calculate swap by querying `Get-Counter "\Paging File(*)\% Usage"`. This
|
|
is also what some libraries like [psutil](https://github.com/giampaolo/psutil/blob/master/psutil/arch/windows/mem.c) use. However, note there are also a few other valid methods of
|
|
representing "swap" in Windows (e.g. using `GetPerformanceInfo`), which all slightly don't
|
|
match.
|