Swap files and RAM?

Discussion in 'OS X Mountain Lion (10.8)' started by Zandra with Z, Oct 20, 2012.

  1. Zandra with Z, Oct 20, 2012
    Last edited: Oct 21, 2012

    Zandra with Z macrumors newbie

    Joined:
    Oct 18, 2012
    #1
    I have 8 GB of RAM, is it possible to use part of it for the swap files? I don't want to use swap files with my SSD.
     
  2. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #2
    Mac OS X uses swap files to store contents of the RAM (from currently unused documents or applications) in order to free RAM for more current use by a current application.
    Using the RAM to store content of RAM instead of using swap files would be a bit paradox, would it not? Because what would be the purpose of freeing RAM and filling it again with the same content? If you do not have enough RAM, get more, depending on the Mac you have.

    And using the SSD to store RAM is not harming the SSD.

    Normally modern SSDs have a theoretical write/read limit of 10,000 to 100,000 cycles (P/E cycles), meaning if you had a 64 GB SSD and its cycle limit would be 10,000, you would have to write 625 TB to it, which would be 351 GB per day everyday for the next five years. Assuming those numbers vary and it would only be a tenth of that, it would still mean 35 GB per day, which under normal usage no average computer consumer does, not even with temporary files.
     
  3. Zandra with Z thread starter macrumors newbie

    Joined:
    Oct 18, 2012
    #3
    Thanks, I know absolutely nothing about tech. :/

    I followed these steps but it still uses 219 GB. :eek:
     
  4. steviewhy macrumors regular

    Joined:
    Oct 12, 2011
    #4
    It's not recommended but you could just disable paging/swapping.

    http://osxdaily.com/2010/10/08/mac-virtual-memory-swap/

    As an alternative you run 'purge" in the terminal manually whenever you want or set it up as a cron job. I think the wear on the SSD will be negligible by just leaving everything as is imo.

    *EDIT*

    I see you were already using the info from the link I posted. Do you have trim enabled?
     
  5. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #5
    If you know nothing about tech, as you claim, then better leave the swapping on.** I never disabled it, because I do not need to, even if my 8 GB of RAM is limiting me sometimes.
    As for the 219 GB number, that is Virtual Memory and not the size of your swap files.

    Open Activity Monitor and go to the System Memory* tab and look for Page Outs and Swap used and report back.


    ** quote from that article


    ----------

    That is the article the OP is referring too and as far as I know, the PURGE command only works when the Developer Tools are installed, but I agree, to leave it as it is.
     
  6. Zandra with Z thread starter macrumors newbie

    Joined:
    Oct 18, 2012
    #6
    Page Outs: 0 byte (0 byte / sec)
    Swap: 0
     
  7. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #7
    Then everything is more than okay, you have enough RAM for your usage and now swapping occurs. Be sure to read the article titled "Mac OS X: Reading system memory usage in Activity Monitor" in my previous post.
     
  8. Zandra with Z thread starter macrumors newbie

    Joined:
    Oct 18, 2012
    #8
    I will. Thank you so much for your help. :)

    ----------

    Yes, I found the command lines yesterday.
     
  9. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #9
    Don't worry about writing data to your SSD and wearing it out. While it is true the NAND cells in a SSD have a finite life (usage) span, you are not going to hit that limit for many years under even heavy usage. Here is a good article explaining how this is a non-issue.
     
  10. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #10
    Don't disable the dynamic pager. It creates all sorts of problem including crashes.

    NAND write cycles used to be a problem when SSD were 32GB or smaller. When controllers had wrote 10-20 MB for every single MB they should have written.
    Today most nand is rated at 3000 cycles and the TLC in the new Samsung 840 probably at 1000 but that is still more than you ever need.

    You can watch in activity monitor how much writes you have in the system. It includes all drives (external and internal afaik). Unless you are way past 50 GB writes a day ON AVERAGE (that means every day) your SSD ist not likely to die from too many writes, but rather form sudden controller death, heat or something.
    With a drive 128GB and up you can safely say that is just a non issue.

    All these idiotic tipps just don't apply anymore. The only sensible reason to disable swapping is to save space because you have too little and those files don't shrink again once they have grown until you restart.
     

Share This Page