Initial Version

This commit is contained in:
Andy Dixon
2026-10-07 12:21:09 +01:00
commit c1ef35d039
7 changed files with 1277 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# swaptop
htop-style view of who is using swap and how. Linux only.
go build -o swaptop . && sudo ./swaptop
Without root you only see full detail for your own processes, and the actions need root.
Header: swap bar split into green (owned by processes), yellow (swap cache: in RAM *and* holding a swap slot, i.e. reserved but not really swapped out) and magenta (tmpfs/shm, not owned by a process). zswap and zram figures appear when present.
Columns: SWAP (in swap now), SWPPSS (proportional share of shared pages), DELTA (change since last refresh), RSS, SWAPPED (share of the process that is in swap).
Keys: `Enter` per-mapping breakdown · `F7` swap a process back in · `F8` page a process out (`process_madvise`, Linux 5.10+) · `F2` flush every swap device (swapoff+swapon) · `F9` kill · `F3` `/` search · `F6` `s` sort · `z` show zero-swap processes · `c` full command line · `F1` help · `q` quit.