Other World Computing
OWC
Our Trusted Vendor

Monitoring system performance with Activity Monitor

Last updated January 8, 2010

Checking memory use on Mac OS X

When there is not enough real memory, the system has to “swap” memory to and from the hard disk so as to share the real memory between programs, which slows everything down tremendously. This is called paging, or virtual memory paging.

You can check the actual real memory usage of an application in Apple’s Activity Monitor (Activity Monitor is available in /Applications/Utilities).

The RSIZE or Real Memory column (same thing) shows the amount of real memory the program is using on the memory chips. To show the — Real Memory column, right-click (control-click) on the column header and select it. The name changes from RSIZE to Real Memory depending on the width of the column—it’s the same thing!

Below we can see that Photoshop is using 2.55GB and Dreamweaver is using 215MB at that particular moment. Actual usage could be higher when activity is taking place, so observe the usage when programs are actually in use, have files open, etc. Ignore the VSIZE figure.

Activity Monitor
Viewing the actual memory usage of programs in Activity Monitor

In my typical workday, I might simultaneously run Digital Photo Professional, Capture NX 2, Photoshop, DreamWeaver, Mail, Safari and a few other programs all at once. Of course, the system itself runs quite a few other “daemon” and background programs. A typical usage scenario is shown below (observe another CS4 issue—a name of “null”).

Activity Monitor
Author’s typical memory use scenario, click for larger image

Note that out of 16GB (above), nearly 8GB of memory is being used in one way or another. Here’s your guide to what the terms mean:

Free
The memory is completely unused.
Wired
The memory is locked down and cannot be shared, or swapped to disk (system software and drivers require Wired memory).
Active
The memory is actively being used by programs and/or the system software.
Inactive
Typically means that the memory has been used to cache disk I/O. This is not a waste, it can greatly speed up some programs, like Photoshop.
Used
Ignore this; it’s a summary statistic.
Virtual memory size, Page ins, Page outs, Swap used
The Page ins and Page outs are useful: ideally these numbers stay a zero (but it’s normal for a small amount of paging to occur). If you see the numbers increasing steadily, install more memory; the system is being forced to swap data from real memory onto disk to share the real memory among programs. Check them before and after a time-consuming task: if they’ve changed more than a few percent, then you almost certainly will benefit from installing more memory. Ignore VM size.

Starting programs, running commands, etc will increase the memory requirements. The Real Memory column is the one that matters—that’s the actual space the program is using in the memory chips.

Monitoring CPU Usage and disk activity

Save 10-15%: buy refurbished direct from Apple

The graphical displays provided by Activity Monitor are excellent. Activity Monitor is found in the Utilities folder under Applications. Drag it into the dock so that it’s always readily available. Especially on dual display systems, it can be left open on the 2nd monitor for conveniently monitoring system performance.

Apple Mac OS X Activity Monitor
Click to got to Activity Monitor in the Finder

For more on CPU cores and how well programs use them, see CPU Cores and Application support for multiple CPU cores.

Percentage CPU usage

Sometimes you want to know which program is using the most CPU time. The main Activity Monitor window shows processes and various information about them.

Choose All Processes in the popup menu at center. Control-click or right-click on column headers to choose which columns to display. Note that the column names are abbreviated when the window size is reduced.

Activity Monitor

Quad-core CPU history in Activity Monitor (mostly idle)

Sort by percentage CPU usage by clicking on the CPU column (triangle should point down as shown). This makes it easy to see which applications are using CPU resources. The example below shows a MemoryTester (dlt) test in progress, taking 364.7% of the available CPU cycles. The remainder is being used by WindowServer, DreamWeaver, etc. One CPU core represents 100%, 2 CPU cores is 200%, etc.

You might find that some “vampire” programs waste CPU time when doing nothing useful— these are programs you don’t want to leave running when you’re not using them!

Disk and network activity

Observe the tabs at bottom (CPU / System Memory / Disk Activity / etc). These show other useful information. Unfortunately, they can be shown only one tab at a time (you can’t watch Disk Activity and Network at the same time).

CPU history graph

The history graph (Window => CPU History) can be sized wider to show CPU history over quite some time (View => Update Frequency). Black areas indicate idle CPU cores. Green represents CPU utilization by user applications, red represents CPU utilization by Mac OS X itself, and blue indicates low-priority tasks. The example below shows a mostly idle system.

Activity Monitor
Quad-core CPU history in Activity Monitor (mostly idle)

The display updates as specified, scrolling left at each interval. Watch this display for your favorite programs, and you can see how well (or poorly) they utilize the CPU cores while doing some hard work, like Unsharp Mask in Photoshop.

For a dual-core system, you’ll see two layers, four layers for 4-core-, eight for 8-core, etc. When we have 32 cores, let’s wait and see what Apple does!

Command line tools for monitoring CPU and memory usage

Monitoring performance in Terminal (a plain-text display) can be useful; it is mentioned here for completeness.

The top and vm_stat tools (and iostat for disk I/O) can come in handy. You must use these tools in a Terminal window. The most useful tool is top, which can be left running continually, refreshing the window at regular intervals.

Show top 10 processes by CPU usage every 2 seconds: top -o cpu -s 2 10
Show top 10 processes by real memory every 2 seconds: top -o rsize -s 2 10

Activity Monitor
'top' display by CPU usage

The vm_stat tool also provides some useful statistics:

Activity Monitor
vm_stat display by CPU usage

Spotlight and mds/mdworker

Spotlight mds mdworker processes
Spotlight and its worker processes ‘mds’ and ‘mdworker”

Spotlight is the feature that indexes your data for fast search, including search in Apple Mail.

Spotlight indexing can be a annoying and productivity-destroying hassle, kicking in when you least want it, or indexing a scratch volume you’re using for Photoshop. If you’re doing any kind of job that relies on fast disk performance (Photoshop scratch, video capture, etc), Spotlight can really rain on your parade.

Spotlight also has an troublesome behavior—if you exclude a volume in its privacy list How, then erase the volume, it considers the erased volume to be a brand-new one, and will index it, say, in the middle of a 30-minute DiskTester test, or during a backup to that newly-erased volume—this can slow backup speed to 1/10 of what it should be on a fast volume.

Apple ought to choose process names that make sense to users so this behavior is not so mysterious— the mds and mdworker processes ought to be have names that contain “spotlight”, instead of their terse ones, reminiscent of Windows process names—Spotlight may be automatic, but its negative and unpredictable effects on performance are a source of confusion.

Monitoring a MacBook or MacBook Pro battery

checking battery status and life and condition on a MacBook Pro
Checking battery status and life

To check on your laptop’s battery life, choose About This Mac… from the Apple menu at top left of the menu bar, click on More Info, and choose Power.

The status shows all sorts of useful things about the battery, including the Cycle Count and Condition.

By 300 full charges, your battery may be capable of only 80% of its original capacity. Time itself causes wear an tear also: after two years most batteries are not up to snuff, even if the recharge count is low.

You can use tools like Battery Health Monitor if you have further concerns.

Help us help you! You support the reviews and how-to articles on this site when you buy from trusted site sponsor Other World Computing (use the links/ads anywhere in this Guide).

OWC does not sell Macs, so when buying a Mac, please click here to go to the Apple store, but remember to save money by getting your memory and hard drives, backup systems, etc at OWC.

Please let others know about this site by posting a hyperlink to site page(s) in discussion forums, web sites, etc — thank you!


Copyright © 2008-2010 diglloyd Inc, all rights reserved | Terms of Use