Solved

top command to list  processes using swap on linux

Posted on 2011-09-19
4
436 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
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
There's a better way to communicate time sensitive or critical info.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 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