fredfromutica

Q: turning off virtual memory

How to reduce virtual memory in lion, I have install the maximum amount of memory on my Macbook Pro but losing valuable hd space due to having an extra partition. I want to recover some disk space.

MacBook Pro, Mac OS X (10.7.4)

Posted on May 14, 2012 4:44 PM

Close

Q: turning off virtual memory

  • All replies
  • Helpful answers

Previous Page 2
  • by Michael Black,

    Michael Black Michael Black Jun 29, 2013 7:12 AM in response to Mohammedsawaie
    Level 7 (24,457 points)
    Jun 29, 2013 7:12 AM in response to Mohammedsawaie

    Keep in mind this is a highly UNrecommended thing to do.

     

    If you have lots of RAM, such that your system is not actually paging out to virtual swap files anyway, then doing the above is rather pointless.  Again, regardless of how much VM page space has been reserved by the system, if your are, in fact, NOT using any swap files space (yet), or if you have lots of RAM, you may never use any actual disk space for swap.  In those cases, disabling the swap files is essentially a complete waste of time, as there are none actually in use on your system anyway.

     

    If you have somewhat or much less RAM then your system needs given the tasks you are running, and you normally or occasionally do actually incur page-outs to swap file(s), then disabling the swap files can cause your system to lock up or crash, and you risk loosing any work in progress in open files, as well as corrupting cache and settings.

     

    Again I will mention, that the size of VM listed in Activity Monitor is NOT swap memory actually in use.  At boot, OS X has to establish page registries in RAM (which are very small) based on the requested VM space of the OS itself and its various associated tasks and daemons.  All that VM represents is address registries to hold the pointers to actual page-outs, if or when page-outs actually do occur.

  • by PegasoneInc,

    PegasoneInc PegasoneInc Jul 28, 2014 3:11 PM in response to Michael Black
    Level 1 (0 points)
    Jul 28, 2014 3:11 PM in response to Michael Black

    It's funny because, while "all" Unix, Linux, and Windows experts seems to agree that virtual memory is "mandatory" and disabling it is a no-no, even on systems with lots of RAM, nobody seems to be able to provide an explanation as to why this is so, at least not in the forum threads related to the topic that I have occasionally browsed in the last few years. And this despite the fact that quite a few "ignorant" users (including myself) have dared to completely disable virtual memory on their systems after installing 16 GB of RAM, and apparently have not experienced any technical glitches. Now, I am not saying that disabling virtual memory is a good idea, it's just that I wish someone who really knows what they are talking about would care to provide an explanation that really makes sense.

     

    For example, the theory that an OS must write stuff to virtual memory (i.e., on disk) makes no sense to me. Say that a process needs more memory that is available in RAM at that moment: if the OS was not designed to at least issue a message telling the user, "Look, this is not possible as I can't find enough memory for it!" then I think this is bad OS design. Besides, if virtual memory is restricted to the size of a designated partition then nothing guarantees that its max size will be sufficient to support the memory allocation request, at least in theory.

     

    Long story short, in my experience both Windows and Linux work just fine with no virtual memory set, and they actually run faster than when VM is enabled. As to whether this will result in a system crash I have yet to see it. BTW, has anyone noticed that the hard drive is slowest hardware component in a system, the bottleneck to performance increase? Why would one ever want to page memory to the HD? I don't.

  • by Bacon Back Bob,

    Bacon Back Bob Bacon Back Bob Sep 14, 2015 1:10 PM in response to PegasoneInc
    Level 1 (0 points)
    Sep 14, 2015 1:10 PM in response to PegasoneInc

    This is exactly right because RAM is so much faster than a HDD the system will be bottlenecked to the slower speed of the HDD if using it as RAM. In theory your fastest speed is with just decent RAM, however certain files logs/dumps/crashes etc get saved to the virtual memory in a case of system crash as well. It isn't really recommend to remove virtual memory because the space should remain unused as a emergency backup and when the system does decide to use it as RAM it should be in the case that the RAM is in fact overloaded and the bottlenecked speed of the HDD can sometimes be faster and actually do its job to improve performance.

  • by newappdev,

    newappdev newappdev Apr 10, 2016 1:15 AM in response to fredfromutica
    Level 1 (8 points)
    Desktops
    Apr 10, 2016 1:15 AM in response to fredfromutica

    Did you find the answer?

    use terminal to unload the launchctl of plist file.

    Good Luck.

Previous Page 2