Big Performance Boost

KGB's Avatar


07 Jan, 2021 04:14 PM

How to Modify the Virtual Memory in a Mac

by Andrew McClain
Related Articles

Like Windows PCs, Macintosh computers use virtual memory to run more programs than the system memory normally could accommodate. A Mac uses a swap file to temporarily store applications and program components that it does not need at the moment. When it needs something from the swap file, it retrieves it and reloads it into RAM. While it's useful, virtual memory can cause your system to run more slowly. You can do a few things to modify the virtual memory of your Mac and increase performance. Some relatively simple fixes include increasing system RAM or running fewer programs, or you can basically turn off virtual memory by deactivating the swap file.

Easier Modifications

Step 1

Increase your Mac's RAM. This makes the Mac rely on virtual memory less, which in turn makes it run more quickly.

Step 2

Make sure you have space available on your hard drive. The swap file increases as needed, and it is on your Mac's hard drive. The more hard drive space you have, the more virtual memory you have available.

Step 3

Run fewer programs simultaneously. Take a look at the applications you have running. Decide if you need them all running at the same time.

Deactivate the Swap File

Step 1

Open the Terminal program. You'll find it in the Utilities folder under the Applications folder.

Step 2

To turn off the swap file, type this command into the Terminal window:

sudo launchctl unload -w /System/Library/LaunchDaemons/

Step 3

To remove the swap files on your system, type this command into the Terminal window:

sudo rm /private/var/vm/swapfile*

Step 4

Close the Terminal program.

Reactivate the Swap File

Step 1

Open the Terminal program.

Step 2

Type this command in the terminal window:

sudo launchctl load -w /System/Library/LaunchDaemons/

Step 3

Close the Terminal program.

This works if you can load your entire operating system and all programs into RAM. Practically speaking you need 8 Gigabytes of RAM. More is better.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac