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: 47ronin on Feb 20, '04 03:56:27PM

Because plain "top" has to refresh as fast as it can, of course the CPU is hogged. If you use even top -s2 the cpu usage drops dramatically. Personally I just use top -us2 and that lowers the apparent cpu usage a lot.



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

Sort of off this topic a bit . . . but since robg talked about aliasing it in his .tcshrc file it's sort of on topic.

Back in Jaguar you could put aliases in a file called aliases.mine that was stored in ~/library/init/tcsh.

I'm assuming that since the shell changed in Panther the .tcshrc file is the new alias location . . . does it go in the same place or someplace else? I've got a couple aliases that I've never recreated since I haven't gotten around to getting non-conflicting advice about where they need to go now.


same



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

Actually no, top is not refreshing as fast as it can. From the top(1) man page: "The default delay between updates is 1 second." (You can easily verify this is true by just running top while looking at the clock.) Moreover, as has been noted, on virtually every other operating system top takes less than 1% (and usually around .1%) of the CPU. There is definitely something strange about Mac OS X and its top command.



[ Reply to This | # ]
Dramatically reduce the CPU usage of 'top'
Authored by: Mikey-San on Feb 22, '04 12:29:57AM

What's odd is that this command, in Mac OS X:

top -d

Consumes 3% or less of the CPU and updates just as frequently.

Ideas? Anyone?



[ Reply to This | # ]