Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 689
  • Last Modified:

LINUX: What processes are using SWAP?

Hi,

How can I see what processes are resident in swap? I'd like to see what application is using my swap.

Thank you.
0
g0all
Asked:
g0all
1 Solution
 
woolmilkporcCommented:
Hi, and Happy New Year!

You could try

ps -e -o rss,vsize,pid,cmd

This will display, besides PID and command, the resident set sizes (main memory) and the total virtual memory sizes of your processes.

The difference between the resident size and total size is the swap space used by that process.

One-liner to calculate that difference (sorted ascending by swap size):

ps -e -o rss,vsize,pid,cmd |awk '{SW=$2-$1; print SW, $0}' |sort -k1n

If "cmd" prints the full command line try "comm" instead to see just the executable's name.
0
 
g0allAuthor Commented:
Happy New Year wmp!

Thank you for your answer! I will check this and revert back later.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now