OS X Mavericks preview: Compressed Memory gives your Mac room to run

Another example of how Apple is trying to make Mavericks more efficient is "Compressed Memory." This technique helps free up memory from dormant apps that don't need it. The net result: your Mac runs and wakes from sleep faster.

If you open a lot of applications, or if some of your apps need a lot of memory, your Mac will slow down. Way down. That's because your Mac runs out of physical RAM to allocate. OS X isn't in the habit of saying no, though, so what it does is create a swap file that gets written to your Mac's hard disk. That swap file contains the contents of inactive memory. Reading from that swap file and writing to it takes time, and that slows the Mac down.

Apple has ameliorated some of the effects of swap memory in machines like the MacBook Air, which uses flash storage instead of a conventional hard drive. The MacBook Air has pretty limited amounts of RAM compared to other Macs but can still run a number of applications simultaneously quicker than Macs with conventional hard drives, thanks to the speed of flash storage. And newer MacBook Airs can go even faster, with speedy PCIe-based storage.

Not all Macs have flash storage, however. And even solid state drives have their limits. The speed of SATA and PCIe interfaces are less than the direct path between the CPU and the installed RAM, creating a bottleneck.

Improving memory efficiency

Apple set out to do things a bit differently in OS X Mavericks, and they've come up with a memory compression scheme that does the trick. Here's how it works:

At any given time, dozens of different processes - applications, background tasks and more - may be running on your Mac. A lot of them you may have absolutely no awareness of, unless you open the Activity Monitor app in your Utilities folder - they're not items that appear in your Dock, and there's no way to interact with them directly.

Before Mavericks memory compression

These processes and the apps you're running may be sitting in memory but not actively using memory. But they're there, and they're grabbing a little piece of your Mac's available RAM. Cumulatively, they take up space and create the potential for slowdowns.

Apple has engineered Mavericks to be aware when your Mac is reaching its physical RAM limit. And when it does, Mavericks leaps into action and figures out which processes are active and which are inactive. It then compresses the memory that the inactive applications have allocated, which frees up more RAM. That keeps your Mac from having to write content out to and read from swap files.

After Mavericks memory compression

According to Apple, compressing and decompressing memory happens "almost instantly," so there's no slowdown and therefore no downside for the user. Apple says that with memory compression on Mavericks, they're seeing 1.4x speed increases in system reponsiveness under load, when opening documents or reactivating inactive applications, even on machines equipped with fast SSDs.

Your Mac has to write out swap files when it goes to sleep and it needs to read the when it wakes up. There's also a big improvement in the time it takes a Mac to wake from standby - 1.5x faster, compared to Mountain Lion.

It's yet another way that Mavericks promises to improve efficiency compared to Mountain Lion and what's come before, which means a faster and better user experience for you.

Have you seen your Mac slow way down as it manages big swap files? Do you think Mavericks will make a big difference for you? How much RAM does your Mac have? I want to hear from you, so please let me know in the comments.

Peter Cohen
Latest in Apple Macos
macOS Sequoia
Here's how to use Window Tiling on macOS Sequoia
Stage Manager running Safari on a MacBook Air
Safari Technology Preview 200 launches with these improvements
Turn off click to reveal desktop macOS Sonoma
This Mac trick lets you quickly access your desktop from anywhere — become a Mac window ninja by mastering this feature
macOS Sequoia
How to use iPhone Mirroring on macOS Sequoia
Windows 11 on Mac with Parallels
CrowdStrike confirms Macs are 'not impacted' by a global outage impacting airlines, banks, and more — and a fix is on the way
macOS Sequoia
I've been using iPhone Mirroring on macOS Sequoia for 24 hours — it's one of the best features we've seen on Mac in a long time
Latest in News
iMore Logo
One more thing… Goodbye from iMore
Jony Ive
Jony Ive’s OpenAI hardware device could be his next world-changing design
NEBULA Cosmos 4K SE with Apple TV
This new 4K projector is tempting me to replace my LG C2 TV, just so I can watch Slow Horses on a 200-inch display
VisionOS 2 app reorganization
visionOS 2 is the first major software update for Apple Vision Pro, and now it's available
macOS Sequoia
macOS Sequoia (version 15) is now available for your Mac with some big upgrades
watchOS 11
watchOS 11 is now rolling out to all Apple Watch users with the Series 6 or newer