OS X

How To Disable Virtual Memory In OS X

Activity Monitor Icon

We recently wrote an article telling you all about what exactly virtual memory was in the context of OS X, what it does, and how you can check how much of it you’re using (using the Activity Monitor, as pictured below). If you can’t be bothered to read the article, shame on you, but to sum it up, while virtual memory can be a very useful to push your RAM to it’s limits, it can also slow down your computer significantly, and many want to know how to disable it.

Here’s how, but it’s not exactly the easiest thing to do and you risk messing up your computer. We hold no responsibility if you mess up your Mac as a result of following this.

1. Open Terminal (Found In Applications > Utilities)

2. Virtual memory on the Mac is controlled by a swap file, and that’s what you’ll need to deactivate. Type this command into the Terminal:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

3. If you want to completely delete the files (really don’t recommend it, as you will never be able to modify virtual memory again), then type this command:

sudo rm /private/var/vm/swapfile*

If you’ve only gone as far as step two and want to reactivate the swap file, type this then close the Terminal:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

I’ll stress again that this is risky stuff, so if you don’t know what you’re doing, don’t try it. Instead, there are some much easier solutions to improving memory performance.

Upgrading the RAM itself is the most obvious one, and you can also run fewer programs at once and create more space on your hard drive. Disabling virtual memory is only something you should do if you have a specific purpose in mind, nothing else.

About the author

Chris

I've been a passionate evangelist for Apple and the Macintosh throughout my working life, my first love was a Quadra 605 working with a small creative agency in the south of Norfolk UK in the mid 1990's, I later progressed to other roles in other Macintosh dominated industries, first as a Senior graphic designer at a small printing company and then a production manager at Guardian Media Group. As the publishing and printing sector wained I moved into Internet Marketing and in 2006 co-founded blurtit.com which grew to become one the top 200 visited sites in the US (according to Quantcast), at its peak receiving over 15 million visits per month. For the last ten years I have worked as an Affiliate and Consultant to many different business and start ups, my key skill set being online marketing, on page monetisation, landing page optimisation and traffic generation, if you would like to hire me or discuss your current project please reach out to me here.

You can also follow me on: and

3 Comments

Click here to post a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Wow – super-old post, but really helpful. Did this on my Mac Pro with 128GB of RAM…not really useful for me, and just burns write cycles on my SSDs.

    And yes, it could cause RAM hungry apps to crash, but if you’ve got a massive amount of RAM and know you’ve got the headroom, you’ll be fine.

  • If you have a massive amount of RAM, I suppose the mac will not use Virtual memory a lot and therefore will not burn write cycles on your SSD, so you might as well leave it on for the few times you do run out of RAM. Can’t hurt, but it can help.