Purge the cargo, Chewie

What to do when the Imperial Operating System is after your memory.


OSX is great, but likes to use a lot of memory. Hopefully 10.9's compressed memory feature will help this somewhat, but sometimes its nice to clean up all your unused RAM that your applications are greedily hoarding.

Its the simplest thing in the world. Simply drop into your terminal, and type:

purge

Voila! Any audio that is coming out of your computer will pause momentarily, but that’s nothing to worry about. Soon, your computer will be humming along with much more breathing room to spare.

So what is it doing under the hood?

According to the man page for purge, this is what it does:

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.

That is, it is basically the same thing as restarting your computer and opening up all your apps again. However, this is a LOT faster, and is a great catch-all solution if your memory is getting hogged by some greedy application (Looking at you Chrome and Firefox!)

It seems as though it was originally intended for developers for debugging their applications, in particular memory leaks

That sounds dangerous. Is it going to mess up my computer?

I’ve used it loads of times when my mac is slowing me down, and have NEVER had any issues with anything after I run it. Sometimes loading things takes a few more milliseconds since it needs to read the state from the disk most likely, but thats about it.

Have fun! And don’t let Jabba find you!

Email me when Nick Donohue publishes or recommends stories