Few Servers

Keyword MEMORY · from our Short

Find what is using memory and swap on a server

On 7 Oct 2026 our 1 GB server had 991 MB in swap after 5 days. One command showed that n8n held 189 MB of it (it shows up as MainThread) and Uptime Kuma 98 MB.

The checklist

  1. The whole machine: free -m. The Swap line's "used" column is what does not fit in RAM.
  2. Biggest swap users per process, in KB (run as root):
for p in /proc/[0-9]*; do awk -v c="$(cat $p/comm)" '/VmSwap/{if($2>10240)print $2, c}' $p/status; done | sort -rn | head
  1. If a name is unclear (like MainThread), read its command line: tr '\0' ' ' < /proc/<pid>/cmdline.
  2. Per Docker container on Ubuntu 24.04: cat /sys/fs/cgroup/system.slice/docker-<full container id>.scope/memory.swap.current (bytes in swap) and memory.current (bytes in RAM).
  3. Is it swapping right now? vmstat 5: the si column is KB per second read back from swap.

The full test

Setting up a new server? The starter kit adds a swap file sized for the machine, along with the rest of the first-hour setup. Pay what you want.