free up inactive ram

Discussion in 'macOS' started by karohan, Dec 12, 2010.

  1. karohan macrumors 6502

    Joined:
    Jun 25, 2010
    #1
    How do I get OS X to free up inactive RAM? I have 8gb of RAM and I am using 1.7 GB of swap but I have 2.11 GB of inactive memory and 511 MB of free memory. That seems weird.
     
  2. iThinkergoiMac macrumors 68030

    Joined:
    Jan 20, 2010
    Location:
    Terra
    #2
    You don't need to. OS X will automatically use that RAM if it needs to. Generally inactive RAM is information from recently launched applications that hasn't been transferred to swap space. Since it's inactive, OS X will overwrite it if it runs out of free space.
     
  3. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #3
    You don't need to do anything to manage RAM. Mac OS X does that automatically, and does it well. You just need to understand it better:

    Mac OS X: Reading system memory usage in Activity Monitor
     
  4. karohan thread starter macrumors 6502

    Joined:
    Jun 25, 2010
    #4
    I read that article, but I don't understand why I still have swap being used when I have inactive memory. Wouldn't it make sense for the memory in the swap file to replace the inactive? Or does the swap memory sort of function like inactive memory as well, and is just there in case I re-open a recently use program.
     
  5. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #5
    It matters if the swap is page-ins or page-outs, but the bottom line is stated in the first part of that article:
    You're better off just ignoring it and let Mac OS X do its job. There's nothing you can do to improve on it.
     
  6. Dalton63841 macrumors 65816

    Dalton63841

    Joined:
    Nov 27, 2010
    Location:
    SEMO, USA
    #6
    This. I have 4GB of ram. at any given moment I am using about 1.5GB, and have about 50MB of free ram, the rest is inactive. Still runs like the day I took it out of the box. Mac knows what it's doing, it's not Windows Me... :p j/k
     
  7. karohan thread starter macrumors 6502

    Joined:
    Jun 25, 2010
    #7
    Sorry, I should've specified, I am witnessing page outs. I'll take all of your guys' advice and ignore it, especially because I don't feel any of the sluggishness, but it just feels odd that swap needs to be used with 8gb of RAM (when I haven't even done too much RAM intensive stuff lately). I guess if I'm not feeling sluggishness though, it's nothing to worry about.
     
  8. davidlv macrumors 65816

    Joined:
    Apr 5, 2009
    Location:
    Kyoto, Japan
    #9
    What matters is the number of page-outs you see. If it is high, you need more RAM.
    If you want to free up that inactive RAM, run Repair Permissions. I have no idea why this works but it does, almost as good as a reboot. Make sure no applications are running first.
     
  9. iThinkergoiMac macrumors 68030

    Joined:
    Jan 20, 2010
    Location:
    Terra
    #10
    I have some page outs on my MacBook, but the number is minuscule compare to the number of page ins. I have over 1,000,000 page ins, and 253 page outs. So it's not an issue.
     
  10. karohan thread starter macrumors 6502

    Joined:
    Jun 25, 2010
    #11
    See that sort of reasoning is concerning me because I have 107k page outs and in iStat Pro my swap is 1.0gb/2.0gb (does that mean 1.0 gb of 2.0 gb is being occupied or I've had 2.0 gb of memory paged out?) with 8gb of RAM. I can't upgrade my RAM anymore with my Macbook Pro. Is it possible that OS X, when purging inactive memory puts in swap because that is quicker than not having it in memory at all?

    I'd rather not run repair permissions because a reboot is just as quick. Especially if I have to quit out of all applications first.
     
  11. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #12
    You don't have to repair permissions or do anything else. Mac OS X will manage your RAM without you doing anything. Just use your Mac and forget about watching RAM usage. If you're experiencing significant loss of performance, then address it. Otherwise, it's a waste of time to try to improve on the built-in memory management in Mac OS X. After all, it's not Windows!
     
  12. rdowns macrumors Penryn

    rdowns

    Joined:
    Jul 11, 2003
    #13

    Modern OSs use swap files no matter how much RAM you have. Stop wasting time witnessing page outs and your computer will seem faster. Studies have also shown that quitting Activity Monitor leads to a better user experience.
     
  13. davidlv macrumors 65816

    Joined:
    Apr 5, 2009
    Location:
    Kyoto, Japan
    #14
    First, relax. :cool::cool::cool: As the poster above said, unless the computer is really slowing down, why worry?
    AFAIK, the ratio at which you should be concerned about page in/page outs has not been cleary defined, but in your case 107k of page outs is extremely low. Maybe if your page outs are 1/3 of your page ins.... then you can start to wonder what application or process is hogging the CPU. Activity Monitor is a good tool for sorting out issues in the hands of someone informed enough to use it correctly, but you are using it to find points to worry about and making incorrect assumptions along the way (107k is really small). So, you really have only 2 choices, read up on the memory management in OSX if you are interested, or just let OSX do its thing. Apple has some of the best software engineers in the field, and while I wouldn't trust all of them with my wallet or my girlfriend, i will leave the memory management in OSX in their good hands.
     
  14. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #15
    Don't ask why.. but it works.

    sudo du -h -d1 /

    ;)
     
  15. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #16
    Why? :D
     
  16. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #17
    /spank!
     

Share This Page