A Zellij plugin that displays aggregated memory usage in a nicely formatted table using smem. Shows PSS (Proportional Set Size) and RSS (Resident Set Size) metrics grouped by process category.
- Aggregated view - Groups processes by category (OpenCode, Node.js, Python, VS Code, MCP Servers, Zellij, etc.)
- Color-coded - Green (<100MB), Yellow (<500MB), Red (>500MB PSS)
- Auto-refresh - Updates every 5 seconds (configurable)
- Modal interface - Opens as a floating pane, close with
qorEsc - Keyboard controls -
rto manually refresh
┌─────────────────────────────────────────────────────────────┐
│ Memory Usage Monitor (smem) │
│ │
│ Category PSS RSS Procs │
│ ─────────────────────────────────────────────────────────── │
│ OpenCode 1.4 GB 1.5 GB 4 │
│ VS Code Server 795.5 MB 811.3 MB 3 │
│ Node.js 312.4 MB 450.2 MB 12 │
│ Python 201.2 MB 245.6 MB 6 │
│ MCP Servers 156.8 MB 203.4 MB 5 │
│ Zellij 59.6 MB 67.4 MB 1 │
│ Shell 12.3 MB 18.9 MB 8 │
│ ─────────────────────────────────────────────────────────── │
│ TOTAL 8.6 GB 12.0 GB 138 │
│ │
│ [q/Esc] Close [r] Refresh Auto-refresh: 5s │
└─────────────────────────────────────────────────────────────┘
- Zellij 0.40.0 or later
smeminstalled on the system- Rust toolchain (for building from source)
# Debian/Ubuntu
sudo apt install smem
# Arch Linux
sudo pacman -S smem
# macOS (via Homebrew)
brew install smemmkdir -p ~/.config/zellij/plugins
curl -L https://github.com/shakudo-io/zellij-smem-plugin/releases/latest/download/zellij_smem_plugin.wasm \
-o ~/.config/zellij/plugins/zellij_smem_plugin.wasmgit clone https://github.com/shakudo-io/zellij-smem-plugin.git
cd zellij-smem-plugin
./build.shThe build script will:
- Install the
wasm32-wasip1Rust target if needed - Build the plugin in release mode
- Copy the
.wasmfile to~/.config/zellij/plugins/
Add this to your Zellij config (~/.config/zellij/config.kdl):
Add to the session keybinds section:
keybinds {
session {
bind "m" {
LaunchOrFocusPlugin "file:~/.config/zellij/plugins/zellij_smem_plugin.wasm" {
floating true
move_to_focused_tab true
}
SwitchToMode "normal"
}
}
}Usage: Press Ctrl+o then m to open the memory monitor.
keybinds {
shared_except "locked" {
bind "Ctrl Shift m" {
LaunchOrFocusPlugin "file:~/.config/zellij/plugins/zellij_smem_plugin.wasm" {
floating true
move_to_focused_tab true
}
}
}
}Add to the plugins section for easier reference:
plugins {
memory-monitor location="file:~/.config/zellij/plugins/zellij_smem_plugin.wasm"
}| Key | Action |
|---|---|
q or Esc |
Close the plugin modal |
r |
Manual refresh |
# 1. Clone and build
git clone https://github.com/shakudo-io/zellij-smem-plugin.git /tmp/zellij-smem-plugin
cd /tmp/zellij-smem-plugin
rustup target add wasm32-wasip1
cargo build --release
# 2. Install plugin
mkdir -p ~/.config/zellij/plugins
cp target/wasm32-wasip1/release/zellij-smem-plugin.wasm ~/.config/zellij/plugins/zellij_smem_plugin.wasm
# 3. Add keybinding to zellij config
# In the session section of ~/.config/zellij/config.kdl, add:
# bind "m" { LaunchOrFocusPlugin "file:~/.config/zellij/plugins/zellij_smem_plugin.wasm" { floating true; move_to_focused_tab true } SwitchToMode "normal" }zellij action start-or-reload-plugin "file:$HOME/.config/zellij/plugins/zellij_smem_plugin.wasm"# Check plugin exists
ls -la ~/.config/zellij/plugins/zellij_smem_plugin.wasm
# Check smem is available
which smem- PSS (Proportional Set Size): Memory unique to process + proportional share of shared memory. Best metric for actual memory consumption.
- RSS (Resident Set Size): Total memory in RAM including shared libraries. Can overcount when libraries are shared between processes.
The plugin automatically groups processes into these categories:
| Category | Matches |
|---|---|
| OpenCode | opencode |
| VS Code Server | code-server |
| Node.js | node, npm, npx |
| MCP Servers | Node processes with mcp |
| Playwright | Node processes with playwright |
| Python | python, uv |
| Zellij | zellij |
| Rust Toolchain | cargo, rustc, rust-analyzer |
| Shell | bash, sh, zsh, fish |
| System Services | systemd, dbus, polkit |
| Git | git |
Processes not matching any category are shown by their original name. If there are more than 15 categories, smaller ones are aggregated into "Other".
zellij-smem-plugin/
├── .cargo/config.toml # WASM build target
├── Cargo.toml # Rust dependencies
├── build.sh # Build & install script
├── src/main.rs # Plugin implementation
├── LICENSE # MIT
└── README.md
# Build debug version
cargo build
# Build release version
cargo build --release
# Hot-reload in Zellij
zellij action start-or-reload-plugin "file:$(pwd)/target/wasm32-wasip1/debug/zellij-smem-plugin.wasm"zellij-tile0.43.1 - Zellij plugin SDK
MIT License - see LICENSE file.
Issues and pull requests welcome at https://github.com/shakudo-io/zellij-smem-plugin