Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use top as a quick replacement for Activity Monitor UNIX
The process list of Activity Monitor is very nice, but oftentimes I want a lightweight alternative that is easy to start, and has very little impact on system resources. In order to achive this goal, I started with the top command as my basis. In its standard mode, top is still a bit resource hungry, so I added a few options (remove costly traversals of kernel datastructures, update every 10 seconds, sort by resident memory size):
/usr/bin/top -R -F -s 10 -o rsize
For making this command easily usable (either by double-click or by Spotlight opening), I used the Execute this command feature (Execute command in a shell activated) with the exec command at the beginning of the above command line in the Save dialog of Terminal. Together with setting the Close the window option in Window Settings... > Shell, this ensures that very little memory is consumed (the shell is replaced by using exec). The resulting Terminal window containing top can be easiy terminated by just typing q when it is active. Additionally, the scrollback buffer should be disabled in Window Settings... > Buffer.

Saving the resulting file under the name topmem.term makes it possible to either double-click the file, or start it by typing topmem in Spotlight and hitting Command-Return. Additional commands can be built, which sort by different fields (e.g. -o cpu, -o time). I have put a ready-made topmem.term as shown above (with green on black colors and slight background transparency) on my website.

[robg adds: I haven't tried the linked topmem.term file, but the rest works as described.]
    •    
  • Currently 1.75 / 5
  You rated: 2 / 5 (4 votes cast)
 
[8,254 views]  

Use top as a quick replacement for Activity Monitor | 3 comments | Create New Account
Click here to return to the 'Use top as a quick replacement for Activity Monitor' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use top as a quick replacement for Activity Monitor
Authored by: melomac on Aug 17, '06 04:25:00PM

what I am realy looking for is a hierarchic tool just like 'ps -fax' would do... for top, my reference still 'top -duk'. any tips ?



[ Reply to This | # ]
Use top as a quick replacement for Activity Monitor
Authored by: hysterion on Aug 20, '06 12:15:48PM
I use pstree (available via darwinports too, but it's just one C file that compiles into one 20 k executable):

$ pstree -u www
-+= 00001 root /sbin/launchd
 \-+= 00231 root /opt/local/apache2/bin/httpd -k start
   |--- 00232 www /opt/local/apache2/bin/httpd -k start
   |--- 00233 www /opt/local/apache2/bin/httpd -k start
   |--- 00234 www /opt/local/apache2/bin/httpd -k start
   |--- 00235 www /opt/local/apache2/bin/httpd -k start
   |--- 00236 www /opt/local/apache2/bin/httpd -k start
   \--- 01051 www /opt/local/apache2/bin/httpd -k start


[ Reply to This | # ]
Use top as a quick replacement for Activity Monitor
Authored by: carstenjs on Aug 22, '06 02:16:01PM
very similar to this old hint.

[ Reply to This | # ]