Force-quit processes to fix a hot Mac with blaring fans

ActivityMonitorIconXYour MacBook has limited battery life, so what do you do when your system’s fans suddenly crank on at full tilt, and you notice that your system is getting hotter and hotter to the touch? Generally this happens when you are in the middle of your work where you have a number of programs and windows open. You may also see the battery life remaining on your system drop to an hour or two at most when you expected to have quite a few more. In addition to a hot system, you may also notice slowdowns with other tasks you attempt to perform, though this will depend on the task and might not always be the case.

This behavior mainly occurs when a process running on your Mac gets stuck in a programming loop. Practically all programs you use in OS X will make use of loops, where the code for some event or process is set to repeat until some condition is met. In most cases, such code will have checks that keeps it regulated; however, a common programming snafu is where such checks fail, resulting in the program attempting the loop as fast as it can, and subsequently uses as much of the system’s power as it can muster.

If this happens, you might find yourself restarting your Mac, or logging out and then back in. In most cases, such actions should clear the fault and allow you to continue your work; however, they can be overkill for a hung process. In addition, in an attempt to run the system as cleanly as possible, in some cases the system will wait for such processes to quit before logging out. However, since they are stuck, you will be left with a paused logout attempt that shows you a blank screen where maybe you can move your mouse around, but thats about it.

An alternative to shutting down or logging out that is far more effective is to seek out and clear these processes using the Activity Monitor utility on your Mac:

  1. Open Activity Monitor (in the Applications > Utilities folder).
  2. In the “CPU” tab, sort the list by “%CPU” in descending order.
  3. Scroll to the top of the list and note any programs in red text that say “Not Responding” and which are using a high CPU percentage.
  4. Select the program.
  5. Click the X button in Activity Monitor’s toolbar to quit it.

You might wonder why not simply use the Force-Quit window (accessed from the Apple menu, or by pressing Option-Command-Escape) for this? The use of Activity Monitor in this case is better than the use of Apple’s Force-Quit dialogue box, because it will allow you to see all processes on your system, as opposed to only the applications you have opened in your user account. Additionally, Activity Monitor’s “Force Quit” feature invokes the same interrupt that is performed with the Force Quit dialogue box.

Hung process in Activity Monitor in OS X

A hung process can use exceptional CPU percentage, drain your Mac’s battery life, and impede on the performance of other processes.

Whenever a process becomes hung up and is in a “Not Responding” state, it means the system can no longer interact with it, and it is essentially dead to the system. In rare cases, hung programs are actually performing some logical action that they will sooner or later recover from, but when this happens they recover within a few moments of being indicated as “Not Responding.” Any program that stays this way for minutes on end is very likely stuck, and needs a force-quit kick-in-the-pants to be cleared of its malfunction.

The act of forcing any program to quit will go against the program’s default functions and the system’s handling of it, which in normal circumstances can cause unwanted behavior and should be avoided. Therefore you might be hesitant to force quit any program on your system, especially background processes that might seem important.

However, there are two reasons why this does not apply to hung processes. For one, since the process is already “dead,” removing it will not affect how the system is already handling it, and will only prevent the process from using excessive CPU. Secondly, most processes in OS X are launched automatically by the system launcher (a process called “launchd”) so when you quit one, if it is required to be running then the system will re-launch it automatically, or will do so when that program’s processes are required. By quitting the process, you are in fact doing the system a favor by allowing it to re-launch the process effectively, instead of waiting for the process to clear itself and then be available to provide the functions the system requires of it.

Therefore, if you see a hung process on your Mac and it is affecting your system’s performance, first wait a few moments to see if it will clear itself, but if not, then use whatever means you can to force it to quit.