How to disable swap file in OS X Leopard

Discussion in 'macOS' started by xor, Jun 5, 2009.

  1. xor macrumors newbie

    Jun 5, 2009
    My theory is quite simple: Swap file is Evil :eek:
    Just don't like idea of swapping on 4GB system :mad: If I ever max it out I will happily buy another 4GB :D

    I googled and found no solution for Leopard :(
    If someone know how to disable swap files in OSX 10.5.7 I and other googling people will appreciate it very much! :apple:
  2. Guiyon macrumors 6502a

    Mar 19, 2008
    North Shore, MA
    Virtual memory is a vital part of any modern OS and many parts of the OS rely on it, whether you like it or not. Things will most likely break at some point if you disable it and, in the case that you do use up all your memory, only kernel panics will await you.
  3. yellow Moderator emeritus


    Oct 21, 2003
    Portland, OR

    In order to disable swap, I'm guessing you'd have to hack your own mach kernel. And when you run out of real RAM, something is going to go poof.
  4. detz macrumors 65816

    Jun 29, 2007
    If it's swapping it's because it has too not because it want's to. If you turn it off your system will not be usable.
  5. mrkgoo macrumors 65816

    Aug 18, 2005
    I'm not sure what you mean by swap file. As Guiyon mentioned, virtual memory is an integral part of any modern OS.

    But something to keep in mind is that the sleep mode for modern macs is defaulted to one that writes out the contents of RAM to the harddrive everytime it sleeps. If you have 4GB like myself, this means a reasonable wait time upon sleeping your mac before it actually passes out, and also 4GB of your harddrive used. You can disable this by reverting to the old style sleep, and then deleting the sleep image file. Google up mac os x hibernate mode.
  6. xor thread starter macrumors newbie

    Jun 5, 2009
    I don't want to disable "Virtual memory", it's not even possible anyway :)

    I want to disable swaping on my HDD. In XP/Vista/Win7 I can do it quite simply :D But I rather create small ramdisk (<1gb) and then set my swap file to reside there (only way in win2000 to disable swapping on hdd) and this give's best results on stability and compatibility side.

    So... how do I create such a ramdisk (I guess I need some kexts?) and how do I set my swap files there?

    And YES, I WAN'T TO RUN OUT OF MEMORY, if it hapens I will know I have to buy another 4GB of cheap DDR2 memory :cool:
  7. miles01110 macrumors Core


    Jul 24, 2006
    The Ivory Tower (I'm not coming down)
    In OS X swap space and virtual memory are the same thing. Here a list of instructions on how to set your swap drive to something other than your main hard drive. Use at your own risk.
  8. old-wiz macrumors G3

    Mar 26, 2008
    West Suburban Boston Ma
    Unless you have a MacPro or one of the new MacBookPros, you're limited to 4GB in most macs.
  9. MisterMe macrumors G4


    Jul 17, 2002
    My, my, my. RAM disk uses ... RAM! That means that you have less RAM for your running tasks. That means that you have to page out to disc more often. Exactly how do you expect RAM disk to save you anything?

Share This Page