Solved

LINUX: What processes are using SWAP?

Posted on 2013-01-02
2
658 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
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 …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 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

19 Experts available now in Live!

Get 1:1 Help Now