Which Process is Taking all the SWAP Memory ?

High SWAP Memory On Linux

Which Process is Taking all the SWAP Memory ?

In this article I will show you different ways to check what are the processes taking all the SWAP memory on Linux.

Using TOP Command

Run TOP command from Linux prompt, press "f" to add additional column, choose SWAP by pressing space part, now press esc. and you will have the swap, now use SHIFT + < or SHIFT + > to sort.

 

Script

Use below script to find all swap for all processes and sort them.

for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less

 

SMEM

smem is an additional package which you can install and simply will show for you all running processes and all information you need.

Installation

To install it simply use yum, apt get on Ubuntu.

Ex.:

yum install smem python-matplotlib python-tk

Command examples:

smem -m

smem -u

smem -w

 


Subscribe to
for video tutorials updates