본문 바로가기
[Server] Linux & Unix/Shell Script

[Linux] Process별 Swap 사용량 확인

by 기미차니 2022. 9. 19.
반응형

Processes-using-swap-memory

1. Display top 10 processes 

1
find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") printf "%10s %-30s %20s\n",process["Pid"],process["Name"],process["VmSwap"]}' '{}' \; | awk '{print $(NF-1),$0}' | sort -hr | head | cut -" " -f2-
cs

 

참고.

https://techlean.wordpress.com/processes-using-swap-memory/

 

Processes-using-swap-memory

Swap space is a restricted amount of physical memory that is allocated for use by the operating system when available memory has been fully utilized. It is memory management that involves swap…

techlean.wordpress.com

 

반응형

'[Server] Linux & Unix > Shell Script' 카테고리의 다른 글

[Linux] grep 시 윗줄, 아래줄 함께 출력 하기  (0) 2023.03.03
[Oracle] 서브파티션 추가 스크립트  (0) 2022.09.05
폴더내 대량 파일 삭제  (0) 2022.08.26
awk 합계 구하기  (0) 2022.04.13
Crontab  (0) 2022.03.10

댓글