This is a website by Willem van Zyl

I'm a project manager, software developer, Apple evangelist and geek from South Africa. I'm passionate about web and mobile application development, usability, productivity, physics, astronomy, science fiction and fantasy.

If you would like to contact me, message me on Twitter or send me an email.

How to find and kill frozen processes in Mac OS X and on the command line

18 Feb 2009

When applications freeze in Mac OS X, they can be forcefully closed by using one of these "Force Quit" methods:

  • Hold down the ⌥ (Option) key, right click on the application’s icon in the Dock, and choose ‘Force Quit‘.
  • Click on the Apple logo in the top left corner of the screen and choose "Force Quit", or press ⌘-⌥-⎋ (Command-Option-Escape), then select the application from the list and click the ‘Force Quit‘ button.
  • Open Activity Monitor from your "/Applications/Utilities/" folder, click on the application in the list of processes, then click the "Quit Process" button in the top left corner of the Activity Monitor window.

If none of these succeed in terminating the application, you’ll need to use Unix's kill command. Open a new Terminal window and enter:

ps aux | grep "{process name}"

... where "{process name}" is the case-exact name of the frozen application.

You’ll see output similar to this:

willem     271   1.7  5.5   549364 116032   ??  S     8:36AM   1:54.11 /Applications/MyApplication.app/Contents/MacOS/myapp-bin
willem     523   0.0  0.0   599780    432 s001  R+    9:25AM   0:00.00 grep MyApplication

The first number listed after your username is the Process ID. Using this PID, enter this command:

kill {PID}

By default, the kill command sends the SIGTERM (terminate process) signal, which gives the process a chance to clean up and close any open files before exiting. If this fails and the frozen process doesn’t terminate, you can enter:

kill -SIGKILL {PID}

... to immediately and forcefully kill the process without giving it a chance to clean up after itself.

SIGKILL should be seen as a last resort and not used unless absolutely necessary.

Do you like this? Share it:

Copyright © Geekology 2011. All Rights Reserved.

Hosted by Code. Like. Clockwork.