Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

List processes by memory usage

Answer:

To list all of your current system's running processes, and sort by memory usage, try

# ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'

    0 [aio/0]
    0 [ata/0]
    0 [ata_aux]
    0 [cqueue]
    0 [events/0]
    0 [kacpi_notify]
    0 [kacpid]
    0 [kblockd/0]
    0 [khelper]
    0 [kintegrityd/0]
.
.
.
29528 /usr/sbin/apache2 -k start
29536 /usr/sbin/apache2 -k start
29860 /usr/sbin/apache2 -k start
30320 /usr/sbin/apache2 -k start
32588 /usr/sbin/apache2 -k start
  1. Display the top 10 processes used up the most of the memory
  2. Display the top 10 processes ranked by memory usage
  3. How to check current memory usage?
  4. Best way to kill all child processes forked by a given program
  5. Display process’ memory usage

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>