Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Increase SWAP on macOS Big Sur (Macbook M1)

Is there possibility to increase swap on macOS Big Sur on Apple Silicon M1?

dynamic_pager has only -F parameter.

Posted on Feb 9, 2021 5:47 AM

Reply
Question marked as Best reply

Posted on Feb 16, 2021 9:23 PM

Thanks for posting the report. The stats in Activity Monitor are worrying.


Looking at the report, a runaway process is using significant amounts of CPU performance (likely also the memory hog). I recommend starting up in Safe Mode to diagnose the issue:


  1. Shut down your MacBook Air (M1).
  2. Press and hold Touch ID until the screen says "Loading startup options".
  3. Select Macintosh HD, hold down the Shift key, and select "Continue in Safe Mode".


When in Safe Mode, no third party apps are permitted to run automatically. If the problem is related to an app, you should notice that initially (before any apps are opened), little to no swap is being used.


Now, open Activity Monitor, and proceed with the below test:


  1. Open an app that you commonly use.
  2. Check swap usage in Activity Monitor.
  3. If swap usage suddenly spikes, that app is the culprit.
  4. If swap usage remains normal, quit the open app, then open another commonly used app.
  5. Repeat steps 1-4 until you find the culprit.


To leave Safe Mode, restart your Mac.

15 replies
Question marked as Best reply

Feb 16, 2021 9:23 PM in response to HNS-

Thanks for posting the report. The stats in Activity Monitor are worrying.


Looking at the report, a runaway process is using significant amounts of CPU performance (likely also the memory hog). I recommend starting up in Safe Mode to diagnose the issue:


  1. Shut down your MacBook Air (M1).
  2. Press and hold Touch ID until the screen says "Loading startup options".
  3. Select Macintosh HD, hold down the Shift key, and select "Continue in Safe Mode".


When in Safe Mode, no third party apps are permitted to run automatically. If the problem is related to an app, you should notice that initially (before any apps are opened), little to no swap is being used.


Now, open Activity Monitor, and proceed with the below test:


  1. Open an app that you commonly use.
  2. Check swap usage in Activity Monitor.
  3. If swap usage suddenly spikes, that app is the culprit.
  4. If swap usage remains normal, quit the open app, then open another commonly used app.
  5. Repeat steps 1-4 until you find the culprit.


To leave Safe Mode, restart your Mac.

Feb 9, 2021 6:00 PM in response to HNS-

Possibly, but macOS will still try to first maximize RAM usage, since that is always faster (and safer) than the internal SSD.


The swapfile resides in a hidden APFS volume named "VM". This allows for the swapfile to grow or shrink as it needs.


Now, because APFS volumes can optionally have a minimum and/or maximum size, I wonder if somehow your VM volume has a maximum size of 8 GB. To resolve this issue, you'll need to erase your VM volume from macOS Recovery:


  1. Start up in macOS Recovery.
  2. If prompted, authenticate with admin credentials.
  3. At the top of the screen, select Utilities -> Terminal.
  4. Type this command and hit Enter (Return): diskutil apfs eraseVolume VM -name VM -role V
  5. When the process is finished, restart your Mac. Swap should now (hopefully) be permitted to grow beyond 8 GB large if it ever needs to.

Feb 16, 2021 10:47 PM in response to Lanny

Thank you for the reply.

I think the CPU is not a problem here.

Current stats:


The computer is running slowly because of memory usage. On the Memory tab I can see the Safari cards with 2 opened pipedrive cards (https://pipedrive.com ), each taking 1-1.5 GB. Safari has killed that because of memory usage and now everything is OK.


I am using a lot of web-applications like Asana, Pipedrive, Microsoft Tasks or LinkedIn and I think that could be a problem.

Feb 9, 2021 7:33 AM in response to HNS-

Hi HNS-,


I'm not sure why you would want to increase swap usage, but it doesn't appear to have the controls needed to set a minimum or maximum size.


macOS first tries to use all of the available memory (RAM) in your Mac before resorting to swap. This is because using swap results in lots of reads and writes on the internal SSD, slowly shortening its lifetime.

Feb 9, 2021 11:06 PM in response to Encryptor5000

Thank you.

I will check that today.

Could you please tell me, what is the risk?


For now I have checked: diskutil apfs list

Result:

        APFS Volume Disk (Role):   disk3s6 (VM)

        Name:                      VM (Case-insensitive)

        Mount Point:               /System/Volumes/VM

        Capacity Consumed:         8589979648 B (8.6 GB)

        Sealed:                    No

        FileVault:                 No


Maybe could I create the new VM volume with size 16GB or more?

Feb 10, 2021 6:15 AM in response to HNS-

If done correctly, there should be no risk. But definitely back up your data before proceeding. AFAIK if macOS can’t find the correct VM volume at startup it will make a new one.


Also, APFS volumes are dynamic by default - they have no fixed size. When you erase the VM volume, it will have an initial size of 0, and will automatically grow and/or shrink as macOS adjusts swap usage.


The true size limit of the VM volume is the amount of free space on your Mac, as your startup disk and VM share free space with each other.

Feb 12, 2021 6:33 AM in response to Encryptor5000

I have done that command: diskutil apfs eraseVolume VM -name VM -role V

It is better, but I still have slowmotion, when too many swap is taken.


Current stats:

APFS Volume Disk (Role):   disk3s6 (VM)

        Name:                      VM (Case-insensitive)

        Mount Point:               /System/Volumes/VM

        Capacity Consumed:         11811209216 B (11.8 GB)

        Sealed:                    No

        FileVault:                 No


Any ideas?

Feb 19, 2021 8:49 AM in response to HNS-

Start by completely removing CleanMyMac. It is unneeded because the macOS, catlike, has cleaned itself for the last two decades. ANY third-party app that claims to clean or maintain yourt Mac WILL slow it and can contribute the the problems you see. CCM is the likely cause of the "runaway process" flag.


Based on hundreds of other EtreCheck reports here, removing CMM improves performance. You also have a number of third party enhancements install. I would review those and see which you really need. Amphetamine an Insomniac may be fighting. More than one installed ad blocker has been suspected in slow computer reports here. Find the one you love and send the other to summer camp.


System Software:

    macOS Big Sur 11.1 (20C69)Â

    Time since boot: About 6 days


In the presence of a mere 8GB RAM, restarting the computer more often than every six days will nicely keep that SWAP issue under control.

Increase SWAP on macOS Big Sur (Macbook M1)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.