macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

Mac OS X and Battery Life
Pages: 1, 2

Also in Mac Dev News Roundup:

Flying High with AirPort

Total OS X Preview

iPhoto Scripts and Plug-ins

Sneak Peek at Canvas 8 for Mac OS X

Rootless X Server on Mac OS X

Here's something ...

I noted that there was a Timbuktu Extension that seemed to keep changing its process number every time the disk access happened. There was also a Timbuktu Extension which retained its process ID. The one that's consistent is the parent process, and it was continually trying to launch the child process, which failed (for whatever reason). Thus, the incrementing process ID, as the parent tried over and over to launch, the system assigned a new PID, slightly higher than the last one used.



Using another wizard trick, I'll let the grep command find any mention of Timbuktu in the output from the ps command, like this (the vertical bar -- | -- allows me to "pipe" the output of the ps directly to grep... line spaces added for clarity) :

[localhost:/Users/peterf] root# ps axuwww | grep 'Timbuktu'

root 2814 64.8 0.5 3484 1320 ?? R 0:01.06
/System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp
/Users/peterf/Applications/Timbuktu Pro X/Timbuktu Pro
X.app/Contents/SharedSupport/Timbuktu Extension

root 321 0.0 0.0 1248 64 ?? Ss 0:02.57
/Users/peterf/Applications/Timbuktu Pro X/Timbuktu Pro
X.app/Contents/SharedSupport/Host Relauncher
/System/Library/Frameworks/Carbon.framework/Versions/A
/Support/LaunchCFMApp
/Users/peterf/Applications/Timbuktu Pro X/Timbuktu Pro
X.app/Contents/SharedSupport/Timbuktu Extension

root 2816 0.0 0.0 5724 0 std R 0:00.00 grep Timbuktu

[localhost:/Users/peterf] root# ps axuwww | grep 'Timbuktu'

root 2824 80.0 0.5 3484 1324 ?? R 0:01.26
/System/Library/Frameworks/Carbon.framework/Versions
/A/Support/LaunchCFMApp
/Users/peterf/Applications/Timbuktu Pro X/Timbuktu Pro
X.app/Contents/SharedSupport/Timbuktu Extension

root 321 0.0 0.0 1248 60 ?? Ss 0:02.57
/Users/peterf/Applications/Timbuktu Pro X/Timbuktu Pro
X.app/Contents/SharedSupport/Host Relauncher
/System/Library/Frameworks/Carbon.framework/Versions
/A/Support/LaunchCFMApp
/Users/peterf/Applications/Timbuktu Pro X/Timbuktu Pro
X.app/Contents/SharedSupport/Timbuktu Extension

root 2826 0.0 0.0 5724 72 std RV 0:00.00 grep Timbuktu

You can see exactly what's going on here:

The "Host Relauncher" with process ID (PID) number 321 is calling LaunchCFMApp to kick-start the Timbuktu Extension. For some reason, it's not starting, which leads to this endless looping. Here we see PID 2814 in the first listing, and a few seconds later, PID 2824.

"top" shows this, before:

Processes: 63 total, 3 running, 60 sleeping... 192 threads 22:49:44
Load Avg: 1.90, 1.61, 1.63 CPU usage: 57.1% user, 23.1% sys, 19.7% idle

To stop this, I killed the parent process with a TERM signal:

sudo kill -TERM 321

Then, the disk access stops, and "top" shows:

Processes: 61 total, 2 running, 59 sleeping... 188 threads 22:50:39
Load Avg: 0.31, 0.70, 0.80 CPU usage: 18.8% user, 23.4% sys, 57.8% idle

Ahhh. Peace and quiet...and a cooler, happier laptop.

Logrolling

Another processor drain I've found is that certain "Classic" apps are showing a modal dialog. I'm not at all sure why this is causing the process to dominate, but it's just another reason that I'm impatient to have all my apps in Cocoa (the native API for OS X)!

Here's a useful debugging/optimizing tool:

sudo tail -f /var/log/system.log

The tail command will show the most recent entries in the system log, and then update the window as new entries are written to the log. This will help isolate NetInfo problems. Just open a fresh Terminal window and leave tail running as you go about your work. You'll notice entries being written to the log as certain types of system events take place.

A variation on this might be useful as well:

sudo tail /var/log/*.log

This will dump the last few lines of every current log file.

Speaking of logs, they are automatically compressed and archived by the system. If you want to examine an archived log, you can do something like:

zcat /var/log/system.log.0.gz | grep 'sudo'

(Do this to see how many times the sudo command has been used ... )

You can dispose of archived logs when they are taking up too much room. rm -i /var/log/*.[7-9].gz will delete all the compressed files with suffixes between 7 and 9 in /var/log/ (the -i ("interactive") option will ask you to confirm each deletion).

I'm very excited to have a full POSIX-compliant OS running on my awesome Titanium PowerBook G4. I hope this article has demonstrated some useful tools to help you get the most out of your Mac.

If there's enough interest, I'll be back to offer some more insights into the brave new world of Mac OS X! Meanwhile, stay cool!

About Peter Fraterdeus

Peter (peterf@mac.com) bought a 128K Mac in October of 1984. He's very sorry to say that it was stolen some time later. He got his first e-mail account in 1985.

Since then, he's been designing fonts as the founder of Alphabets, Inc. in 1987 (now alphabets.com); running web sites with Linux since 1993; writing and teaching digital typography at international conferences; and providing information architecture, typography, and database design for web sites through his consulting company, semiotx.com (formerly designonline, Inc. and dol.com).

He's also a web partner at www.midsummernightstamps.com, a fine-art rubberstamp publisher (check it out!).

Derrick Story is the author of The Photoshop CS4 Companion for Photographers, The Digital Photography Companion, and Digital Photography Hacks, and coauthor of iPhoto: The Missing Manual, with David Pogue. You can follow him on Twitter or visit www.thedigitalstory.com.


Read more Mac Dev News Roundup columns.

Return to the Mac DevCenter.