Solved

LINUX: What processes are using SWAP?

Posted on 2013-01-02
2
665 Views
Last Modified: 2013-01-02
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
Comment
Question by:g0all
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 38736237
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
 
LVL 1

Author Comment

by:g0all
ID: 38736260
Happy New Year wmp!

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

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now