Solved

top command to list  processes using swap on linux

Posted on 2011-09-19
4
424 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
partially answered my question, but still dont have a solid solution
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Email signature management is something that is often overlooked in many organizations or is simply not implemented effectively. Let's take a look at what methods are available for managing this important piece of corporate branding.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 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

9 Experts available now in Live!

Get 1:1 Help Now