Solved

top command to list  processes using swap on linux

Posted on 2011-09-19
4
443 Views
Last Modified: 2012-05-12
greetings,

I want to pull swap usage per process on linux 2.6+,  I see that the I can use run top then press 'f' then 'p' to get swap information.. the problem is that it is interactive.   Is there a command line for top to just spit out swap information that is also sorted by swap?

the reason is I want to take that information and put it in a script.

Thanks

0
Comment
Question by:phatbrain101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 23

Expert Comment

by:nemws1
ID: 36563548
There's no single command in Linux that does this.  It's really hard to determine because some things get put in/out of swap very quickly (I know you're most likely looking for "big pigs" that take up a lot of swap)

Hmm... maybe the shell script on this page will be of some help to you:
  http://northernmost.org/blog/find-out-what-is-using-your-swap/
0
 

Author Comment

by:phatbrain101
ID: 36564095
that actually does not report the swap information as accurately as top then p option for swap.  top showed swap being used while that script kept reporting 0 swap usage.
0
 
LVL 38

Accepted Solution

by:
wesly_chen earned 250 total points
ID: 36570752
Which Linux distribution do you have?
You can install
iotop  (available for Ubuntu and EPEL repository in CentOS/RHEL).
  Then you can see the "SWAPIN" percentage for each process.

Here is the homepage of iotop
http://guichaz.free.fr/iotop/
0
 

Author Closing Comment

by:phatbrain101
ID: 37497706
partially answered my question, but still dont have a solid solution
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

Are client relationship the only driver of a successful MSP? While important, client relationships are only one component. Learn how else MSPs can broaden their horizon and differentiate themselves.
Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

687 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