
Use these read-only commands to check configured swap capacity, current usage and paging activity on Linux. Other UNIX systems, such as Solaris and AIX, have different commands.
Check configured swap devices
swapon --show
cat /proc/swapsOn older Linux systems, swapon -s displays a similar summary. Check each swap device or file, its size, current usage and priority.
Check overall memory and swap usage
free -h
grep -E '^(SwapTotal|SwapFree|SwapCached):' /proc/meminfoThe difference between SwapTotal and SwapFree is the amount of swap allocated. SwapCached is not the same as swap currently being written.
Check active paging
vmstat 1 5
topIn vmstat, review the si and so columns for swap-in and swap-out activity across successive samples. Existing swap usage alone does not establish current memory pressure. Correlate sustained paging with MemAvailable, application memory and disk I/O before taking corrective action.


