Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Phat^Trance

macrumors 6502a
Original poster
Aug 9, 2009
523
41
Is this possible? In Windows im able to change the temp folder of RAM SWAP file to another drive. Can o do the same with Big Sur?
 

appltech

macrumors 6502a
Apr 23, 2020
688
167
I've seen some command-line magic on other forums, but I would not recommend that you do any of that.
macOS really is much better in RAM management, than Windows.
In any case, swap memory is always slower than RAM, macOS tries not to use it at all costs.
I say, if you haven't got sufficient amount of RAM, don't mess up with swap, get more RAM. Almost all the Macs can be upgraded. Use resources like everymac.com to see what options do you have with yours.
 

mj_

macrumors 68000
May 18, 2017
1,618
1,281
Austin, TX
macOS really is much better in RAM management, than Windows.
In any case, swap memory is always slower than RAM, macOS tries not to use it at all costs.
This is no longer true as Big Sur seems to swap quite aggressively, especially on M1-based Macs.

If I remember correctly starting with around 10.10 or 10.11 you had to use sysctl and adjust vm.swapfileprefix to your liking:

Code:
martin@iMac VM % sysctl vm.swapfileprefix
vm.swapfileprefix: /System/Volumes/VM/swapfile
martin@iMac VM %

Haven't tried whether or not that still works on Big Sur but it might be worth a shot.
 
  • Like
Reactions: Wizec

Honza1

macrumors 6502a
Nov 30, 2013
940
441
US
Placing swap on external drive seems like asking for trouble - if the drive becomes disconnected, system will crash. Normally internal SSD should always be the fastest storage and therefore should always host system (with swap). That provides the fastest system for users. And the most reliable. I suspect this is what Apple is planning for now and while there may be rare cases when users need different setup, it will be likely unsupported and untested. If you make this work, let us know. It will be interesting.
 
  • Like
Reactions: gilby101

gilby101

macrumors 68030
Mar 17, 2010
2,921
1,616
Tasmania
I don't think any of the old tricks can work with macOS 11. This is because the sleepimage and swapfiles are in an APFS volume called VM, which gets mounted as /System/Volumes/VM. To make it more complicated, the sleepimage gets hooked into /var/vm whilst the swapfiles don't.

And, I agree, with Honza1 that having them elsewhere is asking for trouble.
In Windows im able to change the temp folder of RAM SWAP file to another drive.
Please don't keep trying to make macOS behave like Windows. It is different and you will enjoy it more by exploring how macOS does work than by comparing each feature to the behaviour of Windows.

One thing you might discover is that macOS is very reluctant to swap, so the whereabouts of the swapfiles is not important. macOS likes to compress RAM and only swaps as a last resort.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.