How to find out which processes are using swap spa

2019-01-05 06:47发布

Under Linux, how do I find out which process is using the swap space more?

14条回答
看我几分像从前
2楼-- · 2019-01-05 07:28

Gives totals and percentages for process using swap

smem -t -p

enter image description here

Source : https://www.cyberciti.biz/faq/linux-which-process-is-using-swap/

查看更多
再贱就再见
3楼-- · 2019-01-05 07:31

Run top then press OpEnter. Now processes should be sorted by their swap usage.

Here is an update as my original answer does not provide an exact answer to the problem as pointed out in the comments. From the htop FAQ:

It is not possible to get the exact size of used swap space of a process. Top fakes this information by making SWAP = VIRT - RES, but that is not a good metric, because other stuff such as video memory counts on VIRT as well (for example: top says my X process is using 81M of swap, but it also reports my system as a whole is using only 2M of swap. Therefore, I will not add a similar Swap column to htop because I don't know a reliable way to get this information (actually, I don't think it's possible to get an exact number, because of shared pages).

查看更多
登录 后发表回答