When force quit doesn't work
Mac OS X's force quit mechanism can be a boon when an applications freezes,
often consuming a large amount of system resources as it flails. However, force quits do not always execute properly, leaving hung or stalled applications in their problematic states.
As described by user Jude Kim on the Apple Discussion boards:
"After an application hangs forever, I tried to force quit. I get the message popup window saying that the application has been forced quit unexpectedly or something like that. But even after that message, there's still a blue light under the application. I can't restart the application and most annoyingly, I can't shut down the computer unless I shut it off with the power switch. I had this problem since I got this computer, please help me."
Fortunately, Apple's "Force Quit" dialogue box is only one of the many ways to approach targeting a process to kill it. Alternative Approaches include:
Activity Monitor Use Activity Monitor to display a list of all the running processes on the computer. You can see if one is displayed improperly or if it's using up large amounts of resources, and then kill it specifically to see if that clears the hang. (see this article for more)
The Terminal Use the terminal to kill a process by PID (Process ID). The PID can be looked up several ways, but the most common are to use Activity Monitor or the command line equivalent "top". Using the command line is a more basic approach to killing the process.
In some cases -- in which a single application causes the Mac OS X kernel to become extremely busy and slows the system to a halt -- having a Terminal window open can prove beneficial.
If you are lucky enough to have a Terminal window open, and can switch to it, you can kill processes that you otherwise would not be able to (since it's virtually impossible to launch Activity Viewer or the Terminal after a thrashing -- freezing -- process starts).
When the freeze ensues, switch to the Terminal window then type the following command:
top
and press return.
You'll be presented with a list of currently running processes. Scan down the "COMMAND" column for Safari (or whatever application is causing the issue) and note the number next to it in the "PID" column. Once you've found the PID, press the Q key to exit the top program, then enter the following command, replacing (PID) with the actual number -- without parentheses:
kill (PID)
and press return.
With any luck, the thrashing will stop and you'll be able to re-grain control of the computer -- or at least gain enough responsiveness to access and save currently open work.
Force shutdown If things get worse and you need to force a shutdown of the whole system, try the following: Instead of using the Finder's menus to shut down, try using the terminal to issue the shutdown command. Open it and type "shutdown -h now" (or "shutdown -r now" for a reboot).
Preventative Measures
Since the problem seems to occur for specific programs, that indicates the problem may lie with the program or some of it's resources. Many times a preferences file or other resource could get corrupted so the program has a hard time reading it.
Try removing the program's .plist file and restart the program. Such .plist files will generally be located in the ~/Library/Preferences folder, and labeled as follows:
- com.(name of developer).(name of product).plist [For instance, com.adobe.Reader7.0.plist for Adobe Reader 7.0].
Simply drag the potentially offending .plist file to the trash, re-launch the hampered application, and check for continuation of problems. In some cases, applications will have several .plist files, so make sure you check for any that contain the product name. Also, note that you may lose some settings or other personal data used by specific applications when these files are deleted
You can also use Spotlight to find other files the program has created in your user library folder, and remove or delete them. Note that doing this most likely will get rid of your personal settings for the program, but most of the time re-entering them in the program's settings will set things up properly again. Additionally, this is only safe for applications that are bundled in one package. Many complex programs put vital items all over the place when they install, and removing them could break the program or reduce its functionality. - if the program has built-in maintenance tools, run them. For instance, Safari has a "Reset Safari" feature that clears caches, cookies, history, and preferences.
Finally, you can remove and reinstall the whole program. Hopefully the program came with an uninstaller script or utility. If not, you can use AppZapper which helps target a particular application's installed resources for easy removal.
Note that an application can hang for multiple reasons, and unfortunately it isn't always the program itself that's the problem. For instance, OS X has an automatic spell checker that's accessed by many programs. If something goes wrong with the spell checker, then any program that accesses the spell checker may hang along with the spell checker.
Feedback? Late-breakers@macfixit.com.
Resources

There are some situations where even this won't work. A process can be blocked in an I/O driver or elsewhere in a kernel function, and even kill -9 won't do the job.
I think that someone did: kill -MacFixit Forums...
Sometime, My finder hang due to the connection to smb is dropped (The windows server is shutdown). I even cannot use command "kill -9" to force quit the program.
How to fix this scenario without force shutdown the Mac.
Thanks.
However, lately I've run into a curious problem in which the shutdown process doesn't recognize that the process it is trying to shut down has quit.
The sequence of steps goes something like this:
1) For some reason I begin to suspect that something is not right (last night it was corrupted icons), so I save my work, and select "Restart" from the Apple menu.
2) For all of the processes, I haven't quit manually, it will pause for about 1 minute, and then give me a message such as "Shutdown canceled because XX wouldn't quit", where XX is the name of a process (e.g., X11, Quicktime Player, TextEdit, ..., Activity Monitor, Terminal, Finder).
In each case, it looks like the process has properly quit, and selecting "Restart" again will cause the next one in line to quit and pause.
3) Eventually, I'll get to the point where the only thing left running is the Finder (and maybe the Dock). At that point Finder will quit and the machine will just sit there (I don't think it is quite frozen, but no program is running to accept the user input).
4) Pressing on the power key brings up a shutdown dialog, but pressing restart send the machine back into the same wait state.
The only way around this I've found is holding the power button down to force a power off. I can then reboot and the system seems to work normally.
I'm running MacOS 10.5.2 on a MacBook Pro, and I have Default Folder (version 4.0.5 I think) installed. I also tend to leave my machine on but asleep most of the time, rebooting only rarely.
There are cases where the process has quit interacting with the keyboard and screen but can still be stuck running. Terminal users might find that process with the PS command, but it's a good chance they're not killable anyway.
Activity Monitor, and its associated process pmTool, can use, on average, about 20% of a single processor's processor time, so on slower Macs, you might not want to run Activity Monitor all the time.
The top line of Top gives information about how many processes are running, stuck or sleeping. Is there a way to find out which processes are the ones which are stuck? I don't see anything obvious in the man page for top about how to do that.
Sometimes, the process that's stuck, is the one shown in top's %CPU column, that's taking up an unusual amount of processor time.
-9 is SIGKILL. Terminate with extreme prejudice.
Mike Jalkut
Also I'm surprised no one has mentioned a key combination that has worked for me many times when I can't Force Quit the usual ways: Hold down Shift-Option-Command-ESC and keep holding it until the app quits.
A few observations.
First off, the Force Quit command does not always have the desired effect the first time it is issued. In my experience it is usually worth trying a second time if the first time doesn't do the job.
The amount of CPU time used by the Activity Monitor depends on the update frequency you choose. I have it open most of the time and keep the update frequency set to once every 5 seconds (anyone know of a way of reducing the frequency even further?)
The 'kill' command should be used with care, especially when you are killing a system process. Killing system processes requires super-user access (either by logging in as root, or by running an su shell, or by using the sudo prefix) for this reason. It is unlikely that you will do any permanent damage, but if you have to kill a system process to relieve a freeze then it's a good idea to re-boot the system after you have performed any necessary data recovery. (The 'shutdown' command also requires super-user access)
If the GUI becomes unresponsive there may be no way of switching to an application that will allow you to force quit any rogue processes. However, if the machine you are working on has Remote Login switched on you may be able to kill - or to shutdown the whole machine - remotely. You should be able to make an SSH connection from another machine and run kill, or shutdown, as if you were logged in via Terminal.
---
Steve4Fluff
- by James P Reid May 12, 2008 4:49 PM PDT
- I have found that many of the application hangs are cause by USB/Firewire devices. After a force quit has be initiated, try unplugging all your USB/Firewire devices and see if the application(s) is/are successfully shutdown.
- Like this Reply to this comment
-
(18 Comments)