OS X Tip – Monitor Hung Applications
If you ever experienced an application that keeps crashing or hangs, you know how frustrating this could be. There are a number of reasons why an application will unexceptionally quit or not respond. These include:
Lack of system resources , such as RAM
OS compatibility of the Application
A corrupt Application preferences file
Bad or corrupted system fonts installed
Faulty system memory
Failing hard drive, or bad blocks on the drive
Application conflict with another application
Lack of required patches installed
If the application unexpectedly quits, most of the time a dialog box would appear and you should have the option to generate a report where you can perform a preliminary forensics and look at all the system calls during the time the application crashed. Generally, this is most of the data that is contained in the system memory.
If the application is hanging, you can inspect what the application is doing in the background by using the fs_usage command.
Open a Terminal Window and find out what the PID is of the hung application:
% ps -ef | grep -i Microsoft
Once you get the PID, then simply run fs_usage against that PID which must be ran as root:
% sudo fs_usage PID
This will output all of the open files that the Application is accessing, or attempting to access. Chances are that if the application is attempting to open/close the same file, or is timing out, then perhaps that file is the culprit. Upon a deeper, more thorough diagnostics, you can drill down and resolve what may be causing your application to stop responding.
You can also use the Activity Monitor in the Utilities directory to perform some mid level troubleshooting as well.