Musings from Mars Banner Image
For Software Addicts: Yes!MaybeNah!
Articles in

Articles in "System Administration"

April 18th, 2007

Apple Mail Slowing Down? VacuumMail Can Probably Help

Originally published 3/9/07, updated 3/26/07:
VacuumMail now comes with a full installer package, which puts VacuumMail in your Utilities folder, the Launch Agent in your Library (makes the LaunchAgents folder if you don’t have one yet), and also optionally includes Peter Borg’s handy Lingon software for customizing your Launch Agent. No other changes are made to VacuumMail itself at this time. I’ve updated the link, though, to point to the new installer download.
VacuumMail Icon

A lively discussion and exchange of information occurred recently on Hawk Wings, the blog site mostly devoted to news and resources for users of Apple’s terrific Mail program. A colleague at work sent me a message on Tuesday, excited when word on Hawk Wings started circulating about a “vacuum” process available for SQLite databases that appeared to dramatically speed up Apple Mail. He had tried the recommended vacuuming and definitely noticed peppier Mail performance. One thing led to another, and before I knew it, I’d become engrossed in developing and polishing up an AppleScript utility to automate a periodic vacuuming of my Mail, which I’m of course dubbing VacuumMail.

As the Hawk Wings discussion unfolded, we learned that Mail maintains an SQLite database called “Envelope Index” in your ~/Library/Mail folder, which gradually grows as the number of emails in your mailbox does. Natively, Mail performs no optimizations on this critical database, which contains pointers to all of your mail that become fragmented and somewhat disorganized over time. At the office, my Envelope Index file was over 100mb, and at home it’s about 30mb. SQLite offers a “vacuum” Hawk Wings Blog Headercommand that rewrites the Envelope Index, optimizing and reorganizing it for faster access. It sounds a bit like what happens when Mac OS X defragments your hard drive periodically.

SQLite IconAt first, news of this function took the form of a shell command you can run in Terminal. It was quite interesting and exciting to see how the Mac users reading of this learned more about it as information was shared, and the command itself became more concise and precise as the day went on. Other users discovered that SQLite offers an “autovacuum” process that can do vacuuming without prompting, and I’m sure that’s a great thing as well. However, we also learned that vacuuming is a more robust and thorough optimizing of the file, since it actually analyzes and rewrites the whole thing, whereas autovacuuming acts only on a certain recent portion of mail pointers. The basic Terminal command turns out to be:

sqlite3 ~/Library/Mail/Envelope\ Index vacuum;

Full article

September 18th, 2006

Building Leopard: An Excuse To Take a Mac OS X Software Inventory

As a self proclaimed Software Addict, I have a real problem. Well, many real problems, actually. Downloading software not only consumes hard disk space, but it also bloats my Preferences folder over time as I launch each software package to try it out. If that weren’t bad enough, many applications leave pieces of themselves in the “Application Support” folder, the “PreferencePanes” folder, the “Contextual Menu Items” folder, the “Services” folder, and sometimes in the “Plugins” and “Input Managers” folders. Then, of course, there are the Unsanity “haxies,” which put themselves in the “Application Enhancers” folder.

The worst problem, of course, is the amount of time my addiction consumes… But I don’t want to talk about that, thanks.

When my addiction was just beginning, I forgot that if I told an installer I wanted the software available “for all users” on my Mac, it would put the pieces in the top-level Library, rather than in my home Library. So, as my Mac has aged and gone through, now, four different versions of Mac OS X, I’ve felt a great need for doing spring cleaning to tidy up a bit. Earlier this year, I bought AppZapper, which I really like. It helped to clean out a ton of preferences, application support, and other files for software I had long ago decided I didn’t want. But that was, unfortunately, just scratching the surface of my depraved software addiction.

When the preview build of Leopard (Mac OS X 10.5) came along recently, I decided to do a completely fresh installation and start over. At first, I assumed Leopard would be too unstable to form a base for this new start—after all, it’s still in an Alpha stage. However, so far I’ve been quite impressed with its degree of stability. With only a few exceptions—mostly in some of the newer functionality—Leopard has proven very reliable indeed. Some of the new features are so compelling for me—particularly the enhancements to Safari, Preview, Mail, and Automator, and the wonderful new DashCode tool—that I decided to try to move as much of my current production environment to the Leopard “fresh slate” as I could.

Having decided this, it seemed logical to turn my housecleaning project into a baseline configuration project. In other words, I would start with nothing but Mac OS X and the Apple apps, and I would move to Leopard all of the software I need for the various projects I’m engaged in, as the need arises. I would document each change to the baseline configuration and note what kind of software or configuration change I was making. This way, I’d end up with a complete software inventory, including all of the various bits that make up my rich Mac OS X environment. In the process, I’d clean out software I don’t really need, which can only be a good thing.

Full article