Trying to tune Mac OS X 10.9 performance on an old Mac (purge command)

Mac OS X 10.9 has been sucking the life out of my old Mac, a 2008 iMac, so I decided to look into ways of bringing life back to my Mac. One way I just wrote about is how to disable the OSX Dashboard. Another way I’m experimenting with is the Mac OS X =purge= command.

The purge command forces the disk cache to be flushed and emptied. Per it’s man page, ”Purge can be used to approximate initial boot conditions with a cold disk buffer cache for performance analysis. It does not affect anonymous memory that has been allocated through malloc, vm_allocate, etc.”

Honestly I don’t know if this will help with the performance, but when your Mac starts swapping RAM with only a browser and iTunes open, you have to try something.

To run purge, just issue it with the sudo command in a Terminal window like this:

sudo purge

On my old Mac there’s a “thud” for about 20 seconds before it comes back to life. The images below show how much memory it frees.

OS X purge command - before and after RAM use

The following images show the effect of running purge on my old Mac. This first images show my Mac’s RAM use with Firefox and iTunes open, with the Mac running for about 24 hours:

As you can see, it appears that there is very little RAM left. Although some of this is an illusion, I can hear the hard drive spin and there’s a definite “thud” if I try to open some other app, because some of that RAM is temporarily taken, and needs to be cleaned up before another app can run.

This next image shows the memory use after I run purge:

As you can see, it appears to clean up about 1 GB of RAM used by the OS X disk cache. That’s a lot of cache. The difference in the “File Cache” in the two images doesn’t account for quite this much RAM use. Also notice in the two images that “App Memory” was significantly reduced by about the same about (over 800 MB).

Closing Firefox and running purge

I forgot to take an image after I closed Firefox and before running the purge command, so I can only show you the after image:

As you see, “Memory Used” is down to 2.24 GB, and all other memory use is lower except for the File Cache, which seems to be making a comeback.

The solution

I don’t know if purge is the solution ... it seems like what needs to be done is to get OS X 10.9 to slow the heck down on older Mac systems. I don’t know if this is configurable through a Mac defaults write command or not, but I’ll keep looking.