top of page
  • Black Facebook Icon
  • Black Twitter Icon
  • Black Pinterest Icon
  • Black Instagram Icon
Search

Swap Relocator For Mac: Boost Your Performance by Changing the Swap File Location



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.


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.




Swap Relocator For Mac




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.


And also: why it seems not possible to adjust (like with mkswap, and swap on/off) the size of the swap? As computers are shipped with more and more memory, it could be useful (especially for SSD) to reduce (shrink) swap space/size/use.


Learn how to remove, swap, replace, repair and clean the keys on your iMac, Mac or MacBook laptop, with our simple Mac keyboard repair guide. Plus: how to swap key functions around using Mac OS X and free Mac tools.


I've got 1G of ram. I want to create atleast 1.5G of swap area to have a total of 2.5G Vmem.MacOS created by default a swap file in it's root filesystem. This is not what I want. I read about the way to move the swap file to another filesystem that can exist on a faster drive. This is also not what I want. My root filesytem is a 18G scsi. What I want is for MacOSX to be able to do what other unix flavor can. Swap out to a device, or a raw partition rather than a swap file in a filesytem. From what I see, it's not possible, but since macosx is a unix derivative, it has to be some hidden feature. To swap to a raw partition has dramatic performace increase over to a file in a filesystem. I've even pre-created 1.5G of raw space in start at the first block of my drive, also to help improve swap performace. But it's idle and reserved for now until I can find out how to use it. Can MacOSX do this? Linux can, Solaris can, IRIX can. OpenBSD, NetBSD, FreeBSD can. I will not believe that OSX can't. Has anyone looked into this?Also can a multiple swaps be used? From what I understand in the Unix world, when creating multiple swap area across different drives, the os stripes between them, dramatic improving the speed of read/write to it. I want to be able to explore to performace potential of osX. I'm sure you guys do too. Let's look into this!Thanks!


you may want to take a look at : luomat/articles/FAQs/Swapfile_Swapdisk/As swap system of OSX is inherited from the Next's one, these readings are very informative. I based my own research on these docs to find out the way to move swapfiles.


If you've got 1GB of physical RAM, congratulations! You're doing the best you can to manage your memory.The OS X virtual memory system only pages memory to disk when it's necessary. It doesn't reserve disk space in advance, rather it grabs 80MB chunks of disk space only when they're needed.Chances are, with your 1GB of RAM, you never have any memory paged to disk. When you use all of your RAM and the first 4096 KB chunk gets paged to disk, it will go to an 80MB swapfile. If you task the system so hard that that file is all used up, OS X will create another 80MB swapfile, etc.You shouldn't think "I want 2.5 GB of virtual memory." In fact, you've already got that, and more--up to the capacity of your hard disk. Got 5 gigs free on your hard drive--congratulations, you've got 6 GB of virtual memory! Got 10 gigs free, you've got 11 GB of virtual memory!


I don't agree with your statement saying that "Chances are, with your 1GB of RAM, you never have any memory paged to disk".I have 640 MB RAM (ok, not 1GB) but I still managed to create about 10 swap files (76,3 MB each) just by opening a 15 or 16MB JPEG with preview.app. other app running were : IE, ircle, finder.app, dock.app, terminal.app, that's all.So I would say, chances are with 1GB of RAM you will have memory paged to disk sooner or later.note that OS9 can open the same JPEG and even a 32MB JPEG without virtual memory, and it does it really faster than preview.app on OSX


I struggled with this one for a while. I even managed to have no swapfile at all a few times (wow, I really, really, really do not recommend this, I'm targeting this at people who think they are frustrated with X's virtual memory and want to turn it off). Anyway, I thought an updated example would be beneficial to anyone trying this technique with X final.Here is the code I used in /etc/rc:swapdir=/Volumes/swap/vm# Make sure the swapfile exists,# first check existence# if not first make sure disk is mountedif [ ! -d $swapdir ]; thenConsoleMessage "mounting directories"mount -t hfs /dev/disk0s6 /Volumes/swapmount -uw /fi # Make sure the swapfile exists,# if not, create directory since disk should be mountedif [ ! -d $swapdir ]; theConsoleMessage "Creating default swap directory"mkdir -p -m 755 $swapdirchown root:wheel $swapdirelserm -rf $swapdir/swap*fiChanges from prev posts: Accomodate that volumes are now stored in the /Volumes directory, gave an example of the disk in the code (disk0s6 is my disk's address and its name is "swap", you'll need to change those to accomodate your partition/disk) -- those dang stars kept throwing me off, so I gave a real life example. Good luck!


You can tell if it worked by looking for three files:swapfile0, swapfile1, and swapfile2They normally live in /var/vm, and you can search for them by doing:sudo find / -name "swapfile*"The resulting list should show clearly where your swap files are currently residing.-rob.


I tried bombich's method and moved the swap file to the disk that had my Classic boot folder. Upon restarting Classic wouldn't lauch because I didn't have the proper privileges. I did a Get Info on that volume and checked "Ignore privileges" and restarted. Classic would now launch, but the apps still wouldn't run right, e.g., FMPro said I didn't have edit rights to any of my databases. It appears that the swap volume is being mounted by root, so the admin user doesn't have the privileges required to use Classic. I eventually got it to work by using GDIF's method at (thanks again, Rob)


The swap file is always mounted as root -- no one else has had a chance to login when the swapfile is created. I'm not sure why your priveleges were messed up -- I can't imagine it had anything to do with the swapfile because priveleges for the swapfile shouldn't have changed. The method worked great for me.


Okay swappees what's cookin?I've read a number of these "swap partition" articles and i guess I am confused.The strategy seems to involve setting it up using the /etc/rc resource configurationscript. But I would think that the right way would actually be to set aside a separate ufs partition with the formatter and then setting the swap area in /etc/fstab...Here is my problem: The manpage indicates that there should be only one /etc/fstab Mac OS X must befar advanced beyond berkeley.. it has three.. LOLfstab.hd:/dev/hd0a / ufs rw 1 1/dev/hd0e /var ufs rw 1 2/dev/hd0f /usr ufs rw 1 2/dev/hd0d /tmp mfs rw,-s=12000,-b=8192,-f=1024,-T=sd660 0 0fstab.rd:/dev/rd0a / ufs rw 1 1/dev/rd0e /usr ufs rw 1 2/dev/rd0f /var ufs rw 1 2/dev/rd0d /tmp mfs rw,-s=12000,-b=8192,-f=1024,-T=rd335 0 0fstab.sd/dev/sd0a / ufs rw 1 1/dev/sd0e /var ufs rw 1 2/dev/sd0f /usr ufs rw 1 2/dev/sd0d /tmp mfs rw,-s=12000,-b=8192,-f=1024,-T=sd660 0 0Oh in case you are wondering about /tmp.. I guess an mfs is a memory file system. I suppose that this means it may, i repeat *may*, indicate that it is really a tmpfs which is typically created within the swap partition and files.. yep.. that may mean you need extra space within your swap partition to allow for heavy use of the /tmp directory. In UNIX typically every application drops its temporary files in that directory.. but OS X is a distant relative and may have lots of locations for temporary files.. who knows?Okay, how would you typically set up the swap partition if you were to use /etc/fstab. Okay, let's look at the manpage. (oh btw Apple has informed that they do not, repeat do not support the UNIX OS only the GUI. So, until Apple developers have some free time to interact with the faithful..)oh, the manpage: fstab sez that yes indeed there is a "swap" type partition which means that /etc/fstab may be used! There is even a "union" or translucent type partition.. this oneis scary don't ask.. it is something SUN contrived and later dropped. LOLso how would you configure your swap partition?okay.. well we have 3 fstab files? btw, this seems extremely silly. there is no documentation on why this would be but it adds a level of complexity to managing file systems which may indicate a poor design.well alright let's look and see what those files say.. hmm how can you put things in fstab which df does not see.. that means they aren't mountable.. what are they doing in fstab? This seems like a bug to me.. but it could be that I just don't understand??????Would some kind soul enlighten me? I am tempted to "hack" my way through this sans documentation but I am liking what I have so far under MAC OS X and I am afraid I might break something.. LOL.. BUT it would be nice if it really behaved like UNIX?Thanks in advance,Peter


Correct.Also, go to and search the developers and users forums there for fstab and swapfile.One of the developers plainly states that fstab does not do what you might think it does in Darwin, and explains why the methods involving changes to /etc/rc - while not what they originally had in mind - are AOK.The idea of just specifying it in fstab would basically work for any of the other Unices I've seen - wait - they all do that but Darwin! :) 2ff7e9595c


 
 
 

Recent Posts

See All
Download MF4800 driver

Como baixar o driver MF4800 para sua impressora Canon Se você possui uma impressora Canon da série MF4800, como MF4890dw ou MF4870dn,...

 
 
 

Comments


!
Widget Didn’t Load
Check your internet and refresh this page.
If that doesn’t work, contact us.
Subscribe to My Newsletter

Thanks for submitting!

© 2023 by Hanna Bakes. Proudly created with Wix.com

bottom of page