Pause CPU hungry background applications

Aug 30, '02 05:46:58AM

Contributed by: Anonymous

Ever looked at your CPU utilization and wondered why some Carbon apps take a few percent of your CPU time even when they're not doing anything? It's typically because they poll for input (was there a click? was there a keypress?) in the traditional Mac style instead of using the new Carbon method of blocking until there is input. Some offenders: Internet Explorer, Adobe Acrobat, iCab, iTunes.

Here's how to pause and resume any process to get back this wasted CPU time, without having to quit and relaunch (and close open windows, etc.). You might even eek out a few more minutes of battery life.

On the command line, first get the PID of the process you want to pause; we'll use Explorer as an example:

  % ps -axww | grep Explor
2001 ?? S 7:55.67 /Applications/Internet Explorer.app...etc
The PID is the number in the first column, or 2001 in this case. To pause a process, send the STOP signal to its PID:
  % kill -STOP 2001
The process will become unresponsive until you send it the CONT (continue) signal:
  % kill -CONT 2001
This is a much nicer way to recover some spare CPU cycles without continually quitting and restarting applications.

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2002083005465815