Summary

 < Day Day Up > 

Managing Processes Graphically: Activity Monitor

As you know, pressing Option-Command-Escape opens a process list and enables you to force-quit open applications from the Tiger Finder. This is fine for many end-user applications, but doesn't provide the same depth of features that you can get from the command-line process management utilities.

For those seeking more control, Apple's Activity Monitor application (path: /Applications/Utilities/Activity Monitor) provides information on all the system's processes, not just the GUI software that is running; consider it a much-improved graphical version of the top command discussed earlier in this chapter.

Figure 12.2 shows the default Activity Monitor display.

Figure 12.2. The Process Listing can show you everything that is running on your computer.


Controlling the Process Listing

Using the controls in the Process Listing screen, you can configure the type of output and amount of the information displayed.

The Filter and Show features help limit the amount of data shown within the process listing. Typing into the Find field filters processes that match the given string. For example, typing Safari would limit the displayed processes to those that have the word Safari in their name. The Show pop-up menu filters processes based on the owner. You can change the setting to show the following categories:

  • All Processes All the processes running on the system.

  • All Processes Hierarchically All the processes running on the system, sorted into a parent/child hierarchy.

  • My Processes The processes running under your user account.

  • Administrator Processes The processes running with administrative rights.

  • Other User Processes Processes running from other user accounts (not including root).

  • Active Processes Processes that are currently running and active.

  • Inactive Processes Processes that are running, but sleeping (not consuming CPU time).

  • Windowed Processes Processes running under the Tiger windowing system (your GUI applications).

The process listing is not, as you might first think, a real-time view of the programs running on the system. The process information is always changing. To avoid overwhelming the user with a list that jumps all over the place, the process list is only updated every few seconds. Using the View, Update Frequency menu selection, you can change the rate at which the list is refreshed. The larger the number, the longer you must wait for updates.

Processes are listed based on seven columns: Process ID, Process Name, User, % CPU, # Threads, Real Memory, and Virtual Memory. Each column can be sorted by clicking on the column heading. Click the small triangle in the upper-right corner of the process list to reverse the sorting order.

A unique feature of Tiger's Activity Monitor is the ability to view process deltas (changes) rather than just the standard column readings. If, for example, you feel that a process might have a memory leak and you want to see whether the memory consumption is increasing, you can select the process in the list, choose View, Show Deltas for Process. The row will change to show only changes (+ or ) from the values displayed at the time you switched viewing modes.

To export the current process listing to an XML file, choose File, Save.

Killing and Signaling Processes

There are a number of ways that you can interact with processes through Activity Monitor. Using the toolbar icons or the View menu, you can inspect a process in the listing and, of course, quit it.

As you learned earlier, telling the operating system to kill a process is really just a matter of sending a signal, such as TERM or HUP. To send a specific signal using Activity Monitor, choose View, Send Signal to Process. A dialog will appear listing the available signals to choose and send, as seen in Figure 12.3.

Figure 12.3. Tiger's Activity Monitor can send specific signals to processes.


Displaying Process Details

If you want even more information about a process, you can double-click it within the listing or highlight it and click the Inspect (I) icon in the toolbar, or View, Inspect Process (Command-I). A detail window, shown in Figure 12.4, appears.

Figure 12.4. View details about a selected process.


At the top of the detail window you can view the following information:

  • Parent Process ID The process that started the selected process. For example, if a user starts a program from the command line (the shell), the ID of the shell is listed as the program's parent process ID. Processes started at boot time list the parent process ID of 1 (launchd). Note that the parent process name is a hyperlink clicking it opens the details window for the parent process.

  • Process Group ID The ID of the group used to start the process.

  • %CPU The amount of CPU time that the process is taking.

  • User The user who owns the process.

The middle portion of the process details window displays information about one of up to three categories, depending on which button in the button bar is highlighted: Memory, Statistics, or Open Files and Ports (not visible for all applications):

  • Memory The amount of memory (real and virtual) being used by the process. For information on memory types, visit (http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/index.html).

  • Statistics Information about how the process is behaving on your system, including threads, CPU time used, and the number of Unix system calls processed.

  • Open Files and Ports A list of resources that are open and in use by the process.

At the bottom of the details window are two buttons: Sample, and Quit. The Sample button takes a sample trace of the process execution over several seconds (this is mostly useful only for developers). The Quit button, as you might expect, offers you the options of quitting (gracefully) or force-quitting the process.

Monitoring System Statistics

At the bottom of the Activity Monitor window are controls for viewing CPU usage, System Memory, Disk Activity, Disk Usage, and Network activity. These provide an overview of all activity and usage across the entire system; they are not dependent on the processes selected in the process listing. Let's run through each pane and the information it contains.

CPU Usage

The CPU pane, shown in Figure 12.5, displays the current activity level of the CPU(s) on your system.

Figure 12.5. View your system activity level in the CPU pane.


Three types of activity are monitored:

  • User CPU time that is used by user-started processes and applications.

  • System Processor usage by the system processes, such as the Window Server and other components of the operating system. The system CPU time often correlates directly to the user activity. Dragging objects within an application, for example, places a load on the application and on the Tiger graphics and event-processing subsystem.

  • Nice CPU time used by processes running with an altered scheduling priority. All user processes start with the same priority of execution. This priority can be adjusted with the nice and renice commands to provide them with more or less access to CPU time.

The fourth value (idle) is actually just a lack of activity (100% minus the other three values). The total number of threads and processes is also displayed.

To the right of the readouts is a scrolling graph that displays the three types of CPU activity.

TIP

In the CPU pane and any other pane, you can alter the colors used in the graph by clicking the color wells to the right of each graphed value.


System Memory

The System Memory pane shows the overall memory usage for the system, as displayed in Figure 12.6.

Figure 12.6. Monitor your system's memory usage.


Although most of the data labels should be obvious (active memory, inactive memory, total used, and so on), the Wired reading might be confusing if you've never encountered it before. Wired memory cannot be written to virtual memory and must remain in real memory by the system. A properly operating idle system should not display an increase in real memory over an extended period of time. If it does, a memory leak in a system component (such as a device driver) might be slowly eating away at your resources.

Disk Activity

The third pane, Disk Activity, tracks your disk usage reads/writes on your drives. This pane is demonstrated in Figure 12.7.

Figure 12.7. View the read/write activity on your local drives.


Disk Usage

The Disk Usage pane, shown in Figure 12.8, displays the amount of available free space on any of your currently mounted volumes.

Figure 12.8. Monitor how much remaining space is available on your local and network volumes.


Use the pop-up menu in the Disk Usage pane to choose the drive you want to monitor.

Network

The final pane, Network, displays the amount of data and packets going in and out of your active network interfaces. Figure 12.9 shows the Network pane.

Figure 12.9. The Network pane can be used to monitor incoming and outgoing data.


Creating Activity Graphs

You've already seen that the Activity Monitor is capable of producing graphs to display your CPU usage, among other things. However, keeping the Activity Monitor window open to view the graphs isn't realistic if you plan to use your computer for actual work.

Thankfully, Apple provides a number of ways of displaying some of the information in floating windows or within the Dock icon. The View, Dock Icon menu provides access to most of these functions:

  • Show CPU Usage Displays an instantaneous view of the CPU usage.

  • Show CPU History Displays a growing graph of CPU usage over time, just like the CPU pane discussed earlier.

  • Show Network Usage Displays incoming and outgoing network traffic.

  • Show Disk Activity Graphs the read/write activity of your system drives.

  • Show Memory Usage Graphs the amount of memory used over time.

  • Show Application Icon Just shows the standard Activity Monitor icon.

If you prefer floating windows rather than a Dock icon, use the CPU Usage and CPU History options under the Window menu. These create small windows with the normal close controls and so forth.

You can also create an even smaller floating window that can be positioned on the menu bar or oriented horizontally or vertically by using the Window, Show Floating CPU Window submenu.

     < Day Day Up > 


    Mac OS X Tiger Unleashed
    Mac OS X Tiger Unleashed
    ISBN: 0672327465
    EAN: 2147483647
    Year: 2005
    Pages: 251

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net