Can I change which drive my swap memory uses?

I've got a 2017 5K 27"iMac with 40Gbs ram and 500Gb of internal flash storage. Due to overcrowding on my internal drive I've moved my OS to a 1TbUSB3.2 external drive. The move to external has pepped up my mac noticeably, but I wonder if I can pep it up even more by using the fast internal drive for my swap memory. Right now the internal flash storage is fallow and used only for temporary app memory storage (eg photoshop).


As I understand it, the MacOS uses the boot drive for reading and writing swap memory. As my internal flash drive, though small, is very fast I would like use it instead of the slower (though still fast) external boot drive. Can I tell my mac to use the flash drive instead of the boot drive for swap memory? If so how? Cheers,

Posted on Jul 4, 2022 1:15 AM

Reply
Question marked as Top-ranking reply

Posted on Jul 4, 2022 7:59 AM

Well nigh impossible and even if you could do it, you risk corrupting your system.


In your current setup with macOS on an external USB drive you are suboptimizing your system and your question implies that you already sense this is the case.


My suggestion is that you re-do your installation the way Apple intended macOS & apps to be installed ... put macOS and your apps back on your internal SSD and move your data to your external 1TB drive.


Even with a boatload of apps, a 500 GB internal SSD is plenty of space for macOS, all your apps and swap file space. For example, on my Mac (also a 5K 27"iMac) with macOS Catalina, Photoshop CC, CaptureOne Pro, PortraitProStudio, Screenflow, MS Office and numerous other apps, only 153GB is used; that leaves plenty of space for swap and other virtual memory.

7 replies
Question marked as Top-ranking reply

Jul 4, 2022 7:59 AM in response to Lars Hansen

Well nigh impossible and even if you could do it, you risk corrupting your system.


In your current setup with macOS on an external USB drive you are suboptimizing your system and your question implies that you already sense this is the case.


My suggestion is that you re-do your installation the way Apple intended macOS & apps to be installed ... put macOS and your apps back on your internal SSD and move your data to your external 1TB drive.


Even with a boatload of apps, a 500 GB internal SSD is plenty of space for macOS, all your apps and swap file space. For example, on my Mac (also a 5K 27"iMac) with macOS Catalina, Photoshop CC, CaptureOne Pro, PortraitProStudio, Screenflow, MS Office and numerous other apps, only 153GB is used; that leaves plenty of space for swap and other virtual memory.

Jul 4, 2022 2:34 AM in response to Lars Hansen

I do not believe that can be done as the Operating System Controls this Function.


If the computer is running off an External Drive with a Fully Installed and Bootable Drive - that is where the Operating System will place the SWAP File, when the Operating System decides one is required.


Additionally, and specific to Big Sur macOS 11 and Monterey macOS 12, the Operating System resides in a Sealed and Read Only Volume that can not be opened by the User or “ Bad Actor “ Software.

Jul 5, 2022 4:23 AM in response to Lars Hansen

You can you move your entire home folder, but you need to keep an additional admin user on the internal. You need to create one to move the home folder anyway. Change the name of your macOS user account and home folder - Apple Support


Many of the large library-based apps can be set up to store files somewhere else. So, it may not be completely necessary to move the home.

Jul 5, 2022 2:55 AM in response to MartinR

Thanks MarinR. As I noted, I've noticed a speed increase since switching to the external which no doubt is do to the extra useable swap space and the freeing up of temp app memory storage. I originally wanted to see how it would go with the OS on the external but am aware that the internal ssd is more than twice as fast so I'll migrate back to it.


When we are talking 'moving data' I'm interested in what is movable actually. My current HD is: System 30Gb, Library 107Gb, Applications 146Gb and ~277Gb in my user/home folder. So moving my home folder to the external should free up 230Gb of space. Can I move the Library and or Applications folders too?

Jul 5, 2022 7:43 AM in response to Lars Hansen

Moving your home folder is possible from a technical standpoint but is at minimum an "iffy" proposition, not least of which is because your home folder contains a hidden /Library folder that is actively used by the system and applications. I do not advise moving your home folder.


For that matter, I do not use my home folder to store any user data. I purposely save all user data to a second/external drive (including music, video & photo libraries). The only difficulty I have run into is that in Outlook 2016 and later, Microsoft has hard-coded mail storage to an arcane folder deep inside the user Library folder and no one has yet found a way to relocate the "Outlook Profiles" folder to another location or drive. It's a bummer. (However, if you use the Mac Mail app, you can relocate your mail folder to another drive by using a symbolic link and giving Mail full disk access.)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can I change which drive my swap memory uses?

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