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
Solved

top command to list  processes using swap on linux

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
Read about why it is more lucrative for an IT company to participate in government projects.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 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