Find the process occupied by swap
in Note with 0 comment
Find the process occupied by swap
in Note with 0 comment

Execute the following command with root authority

All information will be saved in the /proc/$PIDproc/$PID/status It records some memory usage and thread number in a convenient way, Swap usage and other information

 $ for i in `cd /proc; ls |grep "^[0-9]"|awk ' $0 >100'` ; do awk '/Swap:/{a=a+$2}END{print '"$i"', a/1024"M"}' /proc/$i/smaps ; done |sort -k2nr | less

give the result as follows

 Process id swap 2581 8.50781M 6563 7.78906M 1102811 6.67969M 880 2.24219M 781402 2.15234M 783174 2.04297M 797814 1.67578M 785322 1.57031M 781396 1.24609M 797496 1.23047M 781401 1.14844M 3213 0.953125M 3243 0.933594M ... ...
Responses