Mavericks memory compression review

Compressed memory is the only major storage feature in OS 10.9 Mavericks. Here's what it is and how well it works.
Written by Robin Harris, Contributor

For most of Mac history using the standard memory configuration meant a world of hurt. The machine would boot and work well - usually - with one app at a time, but open a few Safari tabs, Mail, a media player and a word processor and switching apps gets s-l-o-w.

In a virtual memory OS - all consumer/server OSs today - physical memory is extended by using mass storage - disk or SSD - to store inactive or little used memory pages. That frees physical memory - DRAM - for use by active programs.

The downside is that moving those pages back to DRAM takes a disk several hundred thousand times longer than accessing them in DRAM. An SSD takes thousands of times as long.

Compressed memory
A new feature of Mac OS 10.9 - Mavericks - compressed memory, increases the effective size of DRAM through inline data compression. This isn't a new idea: over 20 years ago the HP Omnibook 300 used inline compression to double the effective size of its 10MB compact flash card.

What is new is that with multiple cores running an optimized compression algorithm the system can compress/decompress data much faster than swapping to disk or SSD. This saves time and energy, since the system isn't idling waiting for memory page swaps - important for notebooks.

And there's nothing to configure: it works automatically in the background. All you see is a more stable Mac with more memory.

What this means
My main machine is a 2012 MacBook Air with dual-core 2GHz i7, 500GB SSD and 8GB RAM. It is as fast as my 2006 quad-core Xeon Mac Pro was and a lot easier to carry.

But under Mac OS X the swap file would grow quickly as I loaded apps - and especially Safari tabs - and once the swap file reached about 3GB the pain of an app switch would slow down the machine. The fix: a restart with a shutdown that takes longer than the bootup. Clumsy.

Due to Safari memory leaks the swap file could grow to over 16GB. At that point the machine was unusable: drop down menus would take 30 seconds to appear; app switches even longer; and a very long shutdown.

The free utility Memory Clean helped by freeing up physical DRAM and reducing restarts. But MC needs to be manually invoked and takes about 25 seconds to run on my MacBook Air. Faster than a restart but more hassle than I like.

What's different
With Mavericks memory compression I'm seeing much improved behavior from my MacBook Air: tiny swap file sizes; greater stability; and no performance hit. Even with Safari open for almost 4 days and dozens of open tabs, Final Cut Pro, Preview, Mail, VLC, an FTP client, text editor and the usual dozens of background tasks the swap file is a tiny 114MB where normally it would be at least 2500MB - hurting performance - and growing fast.

It is the single biggest improvement so far in my Mac thanks to Mavericks. You can see for yourself in the new Memory pane in the Activity Monitor.

The Storage Bits take
If you were skeptical about the value of a free OS update, fret no more: this single feature makes a lightweight notebook much more viable for power users. As John Siracusa put it in his excellent Mavericks review:

It's a capability win; Mavericks can handle much more demanding workloads than previous versions of OS X before crying uncle.

The ability to easily handle my daily workload is the most important benefit. I'll still use Memory Clean as preventive maintenance, but by effectively doubling the DRAM in my MacBook Air I feel like I've got a new machine.

And if you're buying a new Mac with non-expandable memory, you may not need to buy as much of Apple's high-priced RAM. It's like getting an extra 4-6GB of RAM for free.

Now Apple should buy Disk Warrior and make it a standard OS utility to fix directory cruft!

Comments welcome, of course. What's your favorite Mavericks feature?

Editorial standards