Terminal Tips: Monitor System Performance with Top
Launch the Terminal (located in /Applications/Utilities/). At the command line, type top and hit
return. You will see something that looks like this:
This screen will continue to update live, giving you the latest information on your system performance,
including how much memory you are using, how much processor is being used, and which program is eating up the most of
your system resources. If there is a real hog running on your system, all you have to do is launch another
Terminal window by going to File—>New Shell and type kill followed by the PID number of the system
hog and return to force the program to quit. To quit top, simply hit q or CTRL+C.

Reader Comments (Page 1 of 1)
C.K. Sample, III said 4:14PM on 6-16-2005
Thanks, Scott. Added it. I don't know why I always go the interrupt route...
Reply
Tim Hadley said 4:14PM on 6-16-2005
When running top on linux, I've always noticed that top seems to consume a relatively large amount of system resources, so I avoid leaving it running.
Reply
Todd said 4:14PM on 6-16-2005
What's the difference between top and OSX's Activity Monitor's window? If users are *nix illiterate, this might be easier and less scary.
Reply
Kristin Green said 4:14PM on 6-16-2005
Anyone know of a good tutorial that explains what all that stuff in top means?
Reply
Chris said 4:14PM on 6-16-2005
I'm not sure why top itself should be such a resource hog for you - running it one of the linux boxes here shows it using 0.1%
Reply
J Osborne said 4:14PM on 6-16-2005
You can drop top's resorce usage quite a bit by running "top -FRu" which eliminates the RPRVT and RSHRD stats and also doesn't report on shared lib usage, but cuts resource use from about 15% on my system to about 2%.
I'm guessing Linux's top is faster either because it doesn't report that kind of information by defualt, or because the kernel keeps that information in a handier form for top's use (which may or may not be more handy for the kernel's use!). I beleve top is faster in FreeBSD as well, but FreeBSD's doesn't report RPRVT or RSHRD, or a bunch of other stuff OSX's does.
Reply
Chrstopher Meisenzahl said 2:13AM on 8-11-2005
I've been using top since getting my iBook a month ago. It's great having the beautiful OS X GUI on top of rock solid UNIX.
Chris
http://amateureconblog.blogspot.com/
Reply
Scott said 3:49PM on 9-13-2005
Actually, you just need to press "q" to quit "top". It will nicely return you to a new prompt.
Reply
craig said 9:04PM on 11-13-2005
If you really want to find that system hog try using "top -u". This sorts the processes by cpu usage and the top offenders will be listed first.
Reply
craig said 9:04PM on 11-13-2005
Kristen (Post 8) - If you type "man top" at the command line it will bring up the manual for top. There are explanations of data that top displays.
Reply
Terry said 5:39PM on 11-25-2005
Is there a differences between the 'top' binary used in OSX versus Linux? When I run top on my Mac it usually shows top taking 12-14 percent of the cpu. Even the screenshot shows top using 21.4%. When I run top on my linux box it doesn't even appear in the list.
Reply