| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
memwatch is a read-only Linux memory monitor and terminal TUI for RAM usage, installed DIMM details, memory bandwidth, and the processes using the most resident memory. It is useful when you want a lightweight Rust alternative or companion to tools like free, top, htop, btop, vmstat, dmidecode, and perf.
The default mode is an interactive terminal UI. A --once mode is also available for scripts, diagnostics, CI logs, and non-interactive environments.
Use memwatch when you want to:
Linux memory monitor, terminal memory monitor, Linux RAM monitor, Rust TUI memory monitor, memory bandwidth monitor, RAM bandwidth monitor, Intel uncore IMC monitor, Linux perf PMU, perf_event_open, top RSS processes, process memory usage, DIMM information, memory speed monitor, SMBIOS memory, DMI memory, dmidecode, /proc/meminfo, /proc process monitor.
Run from the repository without installing:
cargo run -- --once
cargo run -- --interval 500msBuild and install the release binary:
make install
memwatch --once
memwatchIf /usr/local/bin is not in your PATH, either add it or install with a custom PREFIX, BINDIR, or INSTALL_PATH.
memwatch targets Linux systems that expose memory and process data through procfs, SMBIOS/DMI data through sysfs or dmidecode, and bandwidth events through Linux perf PMUs.
| System type | Support level | Notes |
|---|---|---|
| Bare-metal Linux on Intel x86/x86_64 with uncore IMC PMUs | Full | Expected to show memory usage, DIMM details, top RSS processes, and read/write/total memory bandwidth when permissions are set up. |
| Linux on Intel x86/x86_64 without IMC PMUs | Partial | Memory usage, DIMM details, and top RSS processes may work. Bandwidth shows N/A with a diagnostic. |
| Linux on AMD x86/x86_64 | Partial | Memory usage, DIMM details, and top RSS processes may work. Bandwidth support is limited to available CPU PMU fallback events and may only report read-side activity. |
| Linux VMs, containers, or restricted hosts | Partial | /proc/meminfo usually works, but DMI tables and hardware PMU counters are often hidden or blocked. |
| Non-x86 Linux | Partial | Basic /proc memory and process data may work. DIMM and bandwidth data depend on platform firmware and PMU support. |
| macOS, Windows, BSD, WSL without Linux hardware sysfs/perf access | Not supported for useful runtime data | The crate may compile on some non-Linux targets, but the monitor expects Linux /proc, /sys, and perf hardware-counter interfaces. |
The TUI requires an interactive terminal. Use --once for automation or non-interactive environments.
| Data | Source |
|---|---|
| System memory summary | /proc/meminfo |
| Top RSS processes | /proc/<pid>/status |
| Direct DMI/SMBIOS table | /sys/firmware/dmi/tables/DMI |
| DMI fallback | dmidecode --type memory |
| PMU event metadata | /sys/bus/event_source/devices |
| CPU online list for AMD fallback PMU events | /sys/devices/system/cpu/online |
| Memory bandwidth counters | perf_event_open |
memwatch does not change memory timings, kernel tunables, process state, swap settings, or any other system configuration.
Required for building:
The manifest does not currently declare a minimum supported Rust version. Use the repository's Cargo.lock for reproducible dependency versions.
Optional but recommended:
On Debian or Ubuntu-style systems, the optional runtime tools are typically in:
sudo apt install make libcap2-bin dmidecodeOn Fedora-style systems:
sudo dnf install make libcap dmidecodeDistribution package names vary. If setcap, getcap, or dmidecode are not in PATH, install the package that provides them for your distribution.
Build a debug binary:
cargo buildBuild an optimized release binary:
cargo build --releaseThe release binary is written to:
target/release/memwatchThe Makefile wraps the release build:
make buildBuild Debian and RPM packages:
make package VERSION=0.1.12
make check-packages VERSION=0.1.12Package artifacts are written to dist/ by default:
Both packages install memwatch to /usr/bin/memwatch, keep the binary executable, and run this during package installation:
setcap cap_perfmon,cap_dac_read_search+ep /usr/bin/memwatchRequired package build tools:
Run the full local check suite:
make checkThat runs:
cargo fmt --check
cargo test
cargo clippy -- -D warningsYou can also run individual targets:
make fmt
make test
make clippyThe recommended install path is through the Makefile:
make installBy default this:
Verify the installed command:
command -v memwatch
memwatch --onceIf you prefer to run the privileged install step explicitly, build first and then run install under sudo:
make build
sudo make installThe prebuild matters because sudo make install runs as root and the Makefile expects the release binary to already exist in that case.
Install under a different prefix:
PREFIX="$HOME/.local" make installInstall to a specific binary directory:
BINDIR="$HOME/.local/bin" make installInstall to an exact path:
INSTALL_PATH="$HOME/.local/bin/memwatch" make installTo install only the binary:
make install-binaryWithout capabilities, memwatch still runs, but DMI details and memory bandwidth counters may be unavailable.
You can apply or reapply capabilities later:
make capabilityCheck the installed capabilities:
make show-capability
getcap "$(command -v memwatch)"Remove the installed binary:
make uninstallYou can also install with Cargo:
cargo install --path .Cargo does not apply Linux file capabilities. If you need protected DMI table reads or perf counter access, apply the capabilities manually or use make install.
The memory summary and top-RSS process list rely on /proc:
test -r /proc/meminfo
ls /proc/1/statusThese data sources normally work as an unprivileged user on Linux. Some containers or hardened hosts may hide process details for other users.
memwatch first tries to read SMBIOS/DMI memory-device records directly from:
/sys/firmware/dmi/tables/DMIIf that does not return installed memory-device records, it falls back to:
dmidecode --type memoryDirect DMI table reads and dmidecode commonly require elevated privileges or the cap_dac_read_search+ep file capability. If DIMM details show as N/A, use the Makefile install path or check the source manually:
sudo dmidecode --type memoryBandwidth readings use Linux perf hardware counters. memwatch discovers events under:
/sys/bus/event_source/devicesOn Intel systems, full bandwidth support expects uncore_imc_* or uncore_imc_free_running_* event-source devices with exported read and write events. Check for them with:
ls /sys/bus/event_source/devices | grep uncore_imcThe binary opens PMU counters with perf_event_open. The Makefile applies:
cap_perfmon,cap_dac_read_search+epcap_perfmon is the relevant capability for perf counter access on kernels that support it. Even with this capability, the kernel may still block access through perf policy. Check the current policy:
cat /proc/sys/kernel/perf_event_paranoidIf bandwidth remains N/A, run a one-off diagnostic as root:
sudo target/release/memwatch --onceSome systems do not expose memory-controller PMU events at all. In that case the rest of the monitor still works and the bandwidth panel reports N/A.
Some filesystems, package managers, or copy operations do not preserve Linux file capabilities. If the installed binary is replaced after install, run:
make capabilityIf setcap rejects cap_perfmon, your kernel or libcap tooling may be too old for that capability name. Basic memory reporting still works without it, but hardware bandwidth counters will likely remain unavailable.
Start the interactive TUI:
memwatchExit the TUI with any of:
Use a custom update interval:
memwatch --interval 500ms
memwatch --interval 2sPrint one text report and exit:
memwatch --onceUse a custom sampling interval for the one-shot report:
memwatch --once --interval 250msIn --once mode, memwatch takes an initial sample, waits for the interval, then takes a second sample so bandwidth can be computed from counter deltas.
Show CLI help:
memwatch --helpCurrent options:
Usage: memwatch [OPTIONS]
Options:
--interval <INTERVAL> [default: 1s]
--once
-h, --help Print help
For the repository About sidebar, useful topics would be:
linux
rust
tui
terminal
memory-monitor
ram-monitor
hardware-monitor
performance-monitoring
memory-bandwidth
perf
pmu
dmidecode
ratatui
| Back | FazBrowse Home | New Git URL |