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


Click here to return to the 'Dramatically reduce the CPU usage of 'top'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Dramatically reduce the CPU usage of 'top'
Authored by: Anidel on Feb 20, '04 11:00:32AM

If you have bash, simply edit your .bashrc or .bash_profile (for differences between them just type 'info bash' in your terminal) and add this line:

alias top='/usr/bin/top -ocpu -R -F -s 2 -n30'

---
Anidel



[ Reply to This | # ]
Dramatically reduce the CPU usage of 'top'
Authored by: skimmilk on Feb 20, '04 11:28:39AM

Top is NOT a CPU hog. However, when it is polling your system for information, it "activates" and spends CPU power for a very short time and it reports itself since it is active. However, over the course of say 30 secs, the consumption is very small.



[ Reply to This | # ]
Dramatically reduce the CPU usage of 'top'
Authored by: lolajl on Feb 20, '04 04:39:25PM

I entered the tcshrc version into my .tcshrc. When I went into terminal and typed in ttop, this is what I got:

[code]tcsh: ttop: Command not found.[/code]

???



[ Reply to This | # ]
Dramatically reduce the CPU usage of 'top'
Authored by: yellow on Feb 20, '04 08:58:36PM

Did you source your .tcshrc after adding this alias?

source ~/.tcshrc



[ Reply to This | # ]
Dramatically reduce the CPU usage of 'top'
Authored by: yellow on Feb 20, '04 09:01:24PM

IMO, you should not alias already existing commands/binaries.



[ Reply to This | # ]
Dramatically reduce the CPU usage of 'top'
Authored by: outofcontrol on Feb 20, '04 10:19:08PM

If you have bash you do as above, but I prefer to put a different name as Rob suggested:

alias ttop='top -ocpu -R -F -s 2 -n30'

Keeping in the habit of using a slightly different name can save you some frustration when not on your own machine.

Don't forget to run:

source ~/.bashrc

afterwards to allow you to use your new alias.



[ Reply to This | # ]
Dramatically reduce the CPU usage of 'top'
Authored by: tpriest@mac.com on Feb 23, '04 06:39:25AM

Hello! Just use the -d and -s switches. Usind the -d -s5 switches will reduce the load to ~1%

tracker_oz



[ Reply to This | # ]