SwapBox Mac OS

broken image


This site contains user submitted content, comments and opinions and is for informational purposes only. Apple may provide or recommend responses as a possible solution based on the information provided; every potential issue may involve several factors not detailed in the conversations captured in an electronic forum and Apple can therefore provide no guarantee as to the.

These advanced steps are primarily for system administrators and people who are familiar with the command line. You don't need a bootable installer to upgrade macOS or reinstall macOS, but it can be useful when you want to install it on multiple computers without having to download the installer each time.

What you need to create a bootable installer

  1. Step One: Create a macOS High Sierra ISO File. To start, we'll need to create an ISO file of macOS.
  2. While all MacBook released in early 2008 and earlier only support up to the 5-year-old Mac OS X 10.7, an upgrade to an Early 2009 or Late 2009 board will all.
  3. Pop open Virtualbox, and Create a new Virtual Machine. Name this MacOS Mojave, and set it to Mac OS X (64-bit). Set the RAM to 4096 MB (or higher if you can achieve it!). When creating the disk, you can use either format versions.
  4. The macOS sandbox is outlined on Apple's developer page: App Sandbox is an access control technology provided in macOS, enforced at the kernel level. It is designed to contain damage to the system and the user's data if an app becomes compromised. Before sandboxing, every application had access to everything the user did.
Swapbox mac os catalina
  • A USB flash drive or other secondary volume formatted as Mac OS Extended, with at least 14 GB of available storage
  • A downloaded installer for macOS Big Sur, Catalina, Mojave, High Sierra or El Capitan

Download macOS

  • Download: macOS Big Sur, macOS Catalina, macOS Mojave or macOS High Sierra
    These will be downloaded to your Applications folder as an app called Install macOS [version name]. If the installer opens after download, quit it without continuing the installation. To get the correct installer, download from a Mac that is using macOS Sierra 10.12.5 or later, or El Capitan 10.11.6. For enterprise administrators, please download from Apple, not a locally hosted software update server.
  • Download: OS X El Capitan
    This will be downloaded as a disk image called InstallMacOSX.dmg. On a Mac that is compatible with El Capitan, open the disk image and run the installer within, which has the name InstallMacOSX.pkg. It installs an app named Install OS X El Capitan into your Applications folder. You will create the bootable installer from this app, not from the disk image or .pkg installer.

Use the 'createinstallmedia' command in Terminal

  1. Connect the USB flash drive or other volume that you're using for the bootable installer.
  2. Open Terminal, which is in the Utilities folder of your Applications folder.
  3. Type or paste one of the following commands in Terminal. These assume that the installer is in your Applications folder and MyVolume is the name of the USB flash drive or other volume you're using. If it has a different name, replace MyVolume in these commands with the name of your volume.

Big Sur:* https://optitorrent.mystrikingly.com/blog/hear-1-3-1.

Catalina:*

Mojave:*

High Sierra:*

El Capitan: F bar 2 0 5 – manage laravel forge servers.

* If your Mac is using macOS Sierra or earlier, include the --applicationpath argument and installer path, similar to the way this was done in the command for El Capitan.


After typing the command:

  1. Press Return to enter the command.
  2. When prompted, type your administrator password and press Return again. Terminal doesn't show any characters as you type your password.
  3. When prompted, type Y to confirm that you want to erase the volume, then press Return. Terminal displays the progress as the volume is being erased.
  4. After the volume has been erased, you may see an alert stating that Terminal would like to access files on a removable volume. Click OK to allow the copy to proceed.
  5. When Terminal says it's finished, the volume will have the same name as the installer you downloaded, such as Install macOS Big Sur. You can now quit Terminal and eject the volume.

Use the bootable installer

Determine whether you're using a Mac with Apple silicon, then follow the appropriate steps:

Apple silicon

  1. Plug the bootable installer into a Mac that is connected to the Internet and compatible with the version of macOS you're installing.
  2. Turn on your Mac and continue to hold the power button until you see the startup options window, which shows your bootable volumes and a gear icon labelled Options.
  3. Select the volume containing the bootable installer, then click Continue.
  4. When the macOS installer opens, follow the onscreen instructions.

Intel processor

  1. Plug the bootable installer into a Mac that is connected to the Internet and compatible with the version of macOS you're installing.
  2. Press and hold the Option (Alt) ⌥ key immediately after turning on or restarting your Mac.
  3. Release the Option key when you see a dark screen displaying your bootable volumes.
  4. Select the volume containing the bootable installer. Then click the up arrow or press Return.
    If you can't start up from the bootable installer, make sure the External Boot setting in Startup Security Utility has been set to allow booting from external media.
  5. Choose your language, if prompted.
  6. Select Install macOS (or Install OS X) from the Utilities window, then click Continue and follow the onscreen instructions.

Learn more

For more information about the createinstallmedia command and the arguments that you can use with it, make sure the macOS installer is in your Applications folder, then enter the appropriate path in Terminal:

  • Big Sur: /Applications/Install macOS Big Sur.app/Contents/Resources/createinstallmedia
  • Catalina: /Applications/Install macOS Catalina.app/Contents/Resources/createinstallmedia
  • Mojave: /Applications/Install macOS Mojave.app/Contents/Resources/createinstallmedia
  • High Sierra: /Applications/Install macOS High Sierra.app/Contents/Resources/createinstallmedia
  • El Capitan: /Applications/Install OS X El Capitan.app/Contents/Resources/createinstallmedia

A bootable installer doesn't download macOS from the Internet, but it does require an Internet connection to get firmware and other information specific to the Mac model.

I just got myself a Macbook Pro with 32GB of RAM.

So imagine my surprise when after a few days of running it, I looked at my memory in activity monitor and noticed that I was running with almost 14GGB of swap ?!?!? (It eventually ballooned to 32-35 GB of disk at one point)

This had been a recurring theme on my old machine with 16GB of Memory. The swap would increase up to 16GB sometimes, as much at 19-20GB+ and I couldn't understand why. I just assumed that when I got more memory the problem would go away.

SwapBox
  • A USB flash drive or other secondary volume formatted as Mac OS Extended, with at least 14 GB of available storage
  • A downloaded installer for macOS Big Sur, Catalina, Mojave, High Sierra or El Capitan

Download macOS

  • Download: macOS Big Sur, macOS Catalina, macOS Mojave or macOS High Sierra
    These will be downloaded to your Applications folder as an app called Install macOS [version name]. If the installer opens after download, quit it without continuing the installation. To get the correct installer, download from a Mac that is using macOS Sierra 10.12.5 or later, or El Capitan 10.11.6. For enterprise administrators, please download from Apple, not a locally hosted software update server.
  • Download: OS X El Capitan
    This will be downloaded as a disk image called InstallMacOSX.dmg. On a Mac that is compatible with El Capitan, open the disk image and run the installer within, which has the name InstallMacOSX.pkg. It installs an app named Install OS X El Capitan into your Applications folder. You will create the bootable installer from this app, not from the disk image or .pkg installer.

Use the 'createinstallmedia' command in Terminal

  1. Connect the USB flash drive or other volume that you're using for the bootable installer.
  2. Open Terminal, which is in the Utilities folder of your Applications folder.
  3. Type or paste one of the following commands in Terminal. These assume that the installer is in your Applications folder and MyVolume is the name of the USB flash drive or other volume you're using. If it has a different name, replace MyVolume in these commands with the name of your volume.

Big Sur:* https://optitorrent.mystrikingly.com/blog/hear-1-3-1.

Catalina:*

Mojave:*

High Sierra:*

El Capitan: F bar 2 0 5 – manage laravel forge servers.

* If your Mac is using macOS Sierra or earlier, include the --applicationpath argument and installer path, similar to the way this was done in the command for El Capitan.


After typing the command:

  1. Press Return to enter the command.
  2. When prompted, type your administrator password and press Return again. Terminal doesn't show any characters as you type your password.
  3. When prompted, type Y to confirm that you want to erase the volume, then press Return. Terminal displays the progress as the volume is being erased.
  4. After the volume has been erased, you may see an alert stating that Terminal would like to access files on a removable volume. Click OK to allow the copy to proceed.
  5. When Terminal says it's finished, the volume will have the same name as the installer you downloaded, such as Install macOS Big Sur. You can now quit Terminal and eject the volume.

Use the bootable installer

Determine whether you're using a Mac with Apple silicon, then follow the appropriate steps:

Apple silicon

  1. Plug the bootable installer into a Mac that is connected to the Internet and compatible with the version of macOS you're installing.
  2. Turn on your Mac and continue to hold the power button until you see the startup options window, which shows your bootable volumes and a gear icon labelled Options.
  3. Select the volume containing the bootable installer, then click Continue.
  4. When the macOS installer opens, follow the onscreen instructions.

Intel processor

  1. Plug the bootable installer into a Mac that is connected to the Internet and compatible with the version of macOS you're installing.
  2. Press and hold the Option (Alt) ⌥ key immediately after turning on or restarting your Mac.
  3. Release the Option key when you see a dark screen displaying your bootable volumes.
  4. Select the volume containing the bootable installer. Then click the up arrow or press Return.
    If you can't start up from the bootable installer, make sure the External Boot setting in Startup Security Utility has been set to allow booting from external media.
  5. Choose your language, if prompted.
  6. Select Install macOS (or Install OS X) from the Utilities window, then click Continue and follow the onscreen instructions.

Learn more

For more information about the createinstallmedia command and the arguments that you can use with it, make sure the macOS installer is in your Applications folder, then enter the appropriate path in Terminal:

  • Big Sur: /Applications/Install macOS Big Sur.app/Contents/Resources/createinstallmedia
  • Catalina: /Applications/Install macOS Catalina.app/Contents/Resources/createinstallmedia
  • Mojave: /Applications/Install macOS Mojave.app/Contents/Resources/createinstallmedia
  • High Sierra: /Applications/Install macOS High Sierra.app/Contents/Resources/createinstallmedia
  • El Capitan: /Applications/Install OS X El Capitan.app/Contents/Resources/createinstallmedia

A bootable installer doesn't download macOS from the Internet, but it does require an Internet connection to get firmware and other information specific to the Mac model.

I just got myself a Macbook Pro with 32GB of RAM.

So imagine my surprise when after a few days of running it, I looked at my memory in activity monitor and noticed that I was running with almost 14GGB of swap ?!?!? (It eventually ballooned to 32-35 GB of disk at one point)

This had been a recurring theme on my old machine with 16GB of Memory. The swap would increase up to 16GB sometimes, as much at 19-20GB+ and I couldn't understand why. I just assumed that when I got more memory the problem would go away.

Swapbox Mac Os X

So after asking around on twitter, I started doing some research on possibly turning off my swap file. This may seem drastic, but many years ago when I was still a Windows user, I'd managed to do the same thing without much ill effect, so I figured … why not?

The instructions and a detailed explanation of what you're doing are here. But the long and short of it is that you need to boot into recovery mode and then run the command

sudo nvram boot-args='vm_compressor=2'

When you boot back into MacOS, you can check that you are running in this mode by running this command

$ sysctl -a vm.compressor_mode

Swapbox Mac Os Downloads

to which you should see this in response
vm.compressor_mode: 2

At first I was very nervous about running out of memory, but then I noticed something interesting. MacOS was still using swap!!!!

I was bummed, I thought I'd gotten it wrong somehow ?, but I hate rebooting my machine so I left things alone and continued to monitor memory/swap usage.That's when I realized something interesting … My swap file usage wasn't disabled, it was just now extremely conservative. I've been using this for almost a month now and the most swap I've ever seen it use is 300MB.

This is my current system swap usage

Swapbox Mac Os Catalina

Amazing right?!

Its exactly what I wanted, and I've run so far without any memory errors or problems. And that's while I am also using Memory Clean 3, to help me occasionally reclaim memory. I've used Memory clean for years and just recently upgraded.

I must mention that I'm not doing anything particularly stressful like video editing, gaming. Just running a couple of docker containers and running some Rspec tests from time time time, so your mileage may vary. If you do turn on conservative swap file usage on MacOS please report back or tweet at me to let me know how it goes!

Update: 10/23/20
I found that enabling 'Automatic Graphics switching' in the Energy Saver section of System preference made the system use up more RAM.

This makes sense, the dedicated AMD Radeon Pro 5500 GPU on my Macbook Pro has 4GB of its own dedicated GDDR6 memory (VRAM), so it makes sense that the integrated graphics system uses RAM when it needs to.

Swapbox Mac Os Download

Apple appears to have fixed the usage of RAM by the integrated graphics to to 1.5GB
Unfortunately this seemed to put lots of memory pressure on my system after a few days, to where I'd see the occasional crash.

So for now I have disabled this option, and my system seems more stable now as my Macbook Pro uses the GPU memory exclusively and doesn't touch my RAM 🙂





broken image