Linux Swap 分区相关命令

  • /proc/swaps 文件
# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       4194300 0       -2
  • /proc/meminfo 文件
# grep Swap /proc/meminfo
SwapCached:            0 kB
SwapTotal:       4194300 kB
SwapFree:        4194300 kB

  • swapon
# swapon -s 
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       4194300 0       -2
  • free

free -g/-k/-m

# free -g
              total        used        free      shared  buff/cache   available
Mem:              1           0           0           0           1           1
Swap:             3           0           3

  • vmstat
# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  0      0 130536    172 1654888    0    0     0     3    1   23  0  0 100  0  0

  • top/atop/htop/glance

参考引用

How To Check Swap Usage Size and Utilization in Linux

Be First to Comment

发表回复