There is lots of memory avaiable(about 4G) but swap is used(200+M) in my fedora box.
I wonder which process is using swap. How can I know it.
ps and top only show the memory usage.
Thanks in advance.
Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM.
Improving the cyberciti.biz command to show a more concise answer:
(echo "COMM PID SWAP"; for file in /proc/*/status ; do awk '/^Pid|VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | grep kB | grep -wv "0 kB" | sort -k 3 -n -r) | column -t
An example output:
COMM PID SWAP
dockerd 662 2736 kB
skypeforlinux 26865 1320 kB
NetworkManager 303 1112 kB
slim 392 1028 kB
redis-server 350 204 kB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With