小编nin*_*inj的帖子

Linux:使用的总交换区 = 进程使用的交换区 +?

因此,我正在尝试对交换使用率高的系统中交换使用的来源进行一些调查:

# free
             total       used       free     shared    buffers     cached
Mem:        515324     508800       6524          0       4852      27576
-/+ buffers/cache:     476372      38952
Swap:       983032     503328     479704
Run Code Online (Sandbox Code Playgroud)

添加每个进程使用的交换:

# for proc in /proc/*; do cat $proc/smaps 2>/dev/null | awk '/Swap/{swap+=$2}END{print swap "\t'`readlink $proc/exe`'"}'; done | sort -n | awk '{total+=$1}/[0-9]/;END{print total "\tTotal"}'
0       /bin/gawk
0       /bin/sort
0       /usr/bin/readlink
28      /sbin/xxxxxxxx
52      /sbin/mingetty
52      /sbin/mingetty
52      /sbin/mingetty
52      /sbin/mingetty
56      /sbin/mingetty
56      /sbin/mingetty
60      /xxxxxxxxxxx
60      /usr/sbin/xxx
84      /usr/sbin/xxx
108     /usr/bin/xxx
168     /bin/bash
220 …
Run Code Online (Sandbox Code Playgroud)

linux memory swap

18
推荐指数
2
解决办法
9469
查看次数

标签 统计

linux ×1

memory ×1

swap ×1