Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I would like to monitor one process's memory / cpu usage in real time. Similar to top but targeted at only one process, preferably with a history graph of some sort.

share|improve this question
What memory statistics do you want? There are lots of them. – vwduder Jan 13 '11 at 11:33
Memory usage over a given time frame, current usage, maximum usage, average. – Josh K Jan 13 '11 at 11:33

3 Answers

up vote 14 down vote accepted

top actually supports focusing on a single process, although it naturally doesn't have a history graph:

top -p PID
share|improve this answer
3  
And since you may not want to look up the PID every time, try something like top -p `pgrep -f /usr/bin/kvm`. – Stefan Lasiewski Aug 17 '10 at 3:33
I use Cacti to monitor some individual processes, but installing a full blown Cacti installation sounds too complex for the simple situation asked here. – Stefan Lasiewski Aug 17 '10 at 3:34
@Stefan: I'm assuming I would have to run that remotely? – Josh K Aug 17 '10 at 4:00
@Josh : Yes you would need to run Cacti (Which requires MySQL, Apache and few other packages) on another server. On most distros, it's pretty simple to install using Yum or apt-get. – Stefan Lasiewski Aug 17 '10 at 20:48

htop is a great replacement to top. It has... Colors! Simple keyboard shortcuts! Scroll the list using the arrow keys! Kill a process without leaving and without taking note of the PID! Mark multiple processes and kill them all!

Among all of the features, the manpage says you can press F to follow a process.

Really, you should try htop. I never started top again, after the first time I used htop.

share|improve this answer
1  
+1 for htop. This is one of the first program I install on a new system. It makes my life much easier. The tree view is also very handy. – Barthelemy Nov 24 '10 at 12:22
top also has colors. Press z. – Tshepang Jan 12 '11 at 1:41
1  
You're right! top has colors! Too bad its colors are quite useless, specially when compared to htop (which fades other users processes and highlights the program basename). – Denilson Sá Jan 12 '11 at 18:17
top can also kill processes without leaving. Just hit k. – AvatarOfChronos Jul 19 '12 at 13:57

I normally use following two :

  1. HP caliper : its very good tool for monitoring processes it you can check call graph and other low level information also. But please note its free only for personal use.

  2. daemontools : a collection of tools for managing UNIX services

share|improve this answer
1  
I used daemontools for years. It's great as a supervisor/watchdog for other processes. How does it help you monitor CPU/memory usage for one process? – Stefan Lasiewski Aug 19 '10 at 4:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.