I'm looking for somthing like top is to CPU usage. Is there a command line argument for top that does this? Currently, my memory is so full that even 'man top' fails with out of memory :)
top you can try the following:
- Press SHIFT+f
- Press the Letter corresponding to %MEM
- Press ENTER
You might also try:
$ ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr | head -5
This will give the top 5 processes by memory usage.
If you have it installed I like
htop once launching it you can press f6, down arrow (to
MEM%), enter to sort by memory.
top starts, press F to switch to the sort field screen. Choose one of the fields listed by pressing the key listed on the left; you probably want N for
In Solaris the command you would need is:
prstat -a -s size
This will list all processes in order of descending process image size. Note that the latter is based on memory committed to the process by the OS, not its resident physical memory usage.
There are supposedly versions of "top" available for Solaris, but these are not part of the standard installation.
One nice alternative to
htop. Check it, it is much more user friendly than regular top.
This command will identify the top memory consuming processes:
ps -A --sort -rss -o pid,pmem:40,cmd:500 | head -n 6 | tr -s " " ";z"
You can try
ps aux --sort -rss | head or
ps aux | sort -nk +4 | tail