Why free, docker stats and ps disagree about memory on your VPS (measured on a 1 GB box)
Description and use
On a 1 GB VPS, free, docker stats, and ps report different memory values because they measure different aspects. free’s available column best indicates readiness for shortage, docker stats omits swap, and RSS/PSs give different views of process consumption.
Problem
Different system tools report conflicting memory usage on a 1 GB VPS, leading to misinterpretation of resource consumption.
Outcome
The article demonstrates that free’s available column, docker stats, ps RSS, and PSS each measure different aspects of memory, and that misreading them can lead to under‑ or over‑provisioning of RAM.
Workflow
- 1. Run
free -mto view used, available, and swap usage. - 2. Run
docker stats --no-streamto sum container RAM (excluding swap). - 3. Sum RSS from
psor/proc/<pid>/smaps_rollupfor per‑process view. - 4. Sum PSS from
/proc/<pid>/smaps_rollupfor accurate process cost. - 5. Read cgroup files
/sys/fs/cgroup/.../memory.currentandmemory.swap.currentfor each container. - 6. Use
vmstat 1 5to monitor swap I/O and kernel activity.
Evidence
They count different things. free reports the whole machine, and its available column (192 MB here) is the one that tells you how close you are to trouble.
docker stats added up to only 343 MB because it leaves out swap and the cache the kernel can drop: n8n showed 24.6 MiB while another 195 MB of it sat in swap.
RSS is every page a process has in RAM, including pages it shares with others: libraries, and memory a parent process shares with its workers.
PSS is the same pages, with each shared page split between the processes sharing it.
The kernel's own estimate of what is still usable, MemAvailable, was 192 MB, and that is what free prints as available.
- Record date: 2026-10-10T15:56:03.509Z