Inactive RAM usage

Discussion in 'MacBook Pro' started by fryc86, Dec 30, 2012.

  1. fryc86 macrumors member

    Joined:
    Mar 1, 2011
    #1
    I'm sure this has been covered but I've gotten different answers in my searches about inactive ram and how it affects the computer's performance and how much is normal, so I wanted to check here on my specific problem.

    I have a retina MBP 16gb ram and recently, what I would think is, a lot of ram has been delegated to inactive status over. I first noticed this happening a couple of days ago when my computer got really sluggish. I have been told that inactive memory is just stored to reopen recently used programs more quickly and does not slow down overall performance as it is re-delegated to used memory when needed, or something to that effect. However I have repeated the results a few times now whenever I go about my normal business (a number of tabs along with a torrent program and sometimes a VLC video playing) the inactive memory skyrockets. I have been told that google chrome could be a culprit and whenever I check activity monitor Google Chrome Renderer seems to be a big player. If the answer is just to stop using Chrome that is fine, but I wanted to check to make sure. I shouldn't think that I would need to use the purge command so often to keep this machine running smoothly, although it does help...

    thanks :)
     

    Attached Files:

  2. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #2
    I personally wouldn't worry about inactive ram, its inactive meaning that its currently not being used but available if the system needs it.

    By issuing the purge command you move it from inactive to free. The downside of that is that the information that was in there is removed. So if you were running Lightroom (and then exited it), and purged the memory, but then decided to go back into LR, the app would be slower starting up. If you left OSX to manage the resources then LR would start much faster since much of it was in inactive ram.

    Basically OSX has an excellent memory management system, buy trying to do stuff yourself to "improve it" means you can hamper performance.
     
  3. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #3
    thanks :) that's what I've been told and what I assumed, but I'm just having a hard time understanding why my computer slows down so much every time the inactive ram skyrockets :p but thanks anyways :)
     
  4. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #4
    Your page-outs are only 72mb - that's wicked low. Page outs occur when ram is running low and it needs to write some of the pages to the swap file. Since its low you're not really running short on ram
     
  5. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #5
    okay thanks... must be something else going on then since it happens every single time... alright well back to the drawing board lol
     
  6. Blondie :) macrumors 6502a

    Blondie :)

    Joined:
    May 12, 2010
    Location:
    Prescott, AZ
    #6
    10.00 GB is a huge inactive file though. Personally, I don't like inactive RAM that much. In order to free up inactive RAM, you can go into terminal and type purge into the command window. I feel that it helps me quite a bit, as I open different apps all of the time, not the same ones.
     
  7. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #7
    If you're having performance issues, this may help:
     
  8. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #8
    yep :) that's what I've been relying on lately. It's getting me by, it's just annoying because I can't imagine what would need that much reserve ram. This never even happened back when I was using photoshop or games or anything like that on a regular basis, just internet and movies mostly :p
     
  9. Blondie :) macrumors 6502a

    Blondie :)

    Joined:
    May 12, 2010
    Location:
    Prescott, AZ
    #9
    Well, you'll get inactive RAM whenever you close a program. If you leave your computer on for a very long time without a full shutdown, the closed programs and inactive RAM definitely add up over time. I currently have 500 MB of inactive RAM and my computer has been up for 4 days. Only quite iPhoto once I think. Personally, I'm not too big of a fan of Apple's memory usage algorithm, but I guess there's not a whole lot I can do about it.
     
  10. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #10
    thanks :) yeah that all makes sense :) but this is approx. 10GB of buildup over the span of a few hours from a previous restart :p seems a little excessive to me lol especially when I never had to restart my computer for anything except when I was installing new updates :p
     
  11. Blondie :) macrumors 6502a

    Blondie :)

    Joined:
    May 12, 2010
    Location:
    Prescott, AZ
    #11
    If you have 10.00 GB of swap built up over a few hours that seems a little excessive. Sounds like something is eating way more RAM than it should. I checked through your activity monitor picture you posted, but nothing seems to be the culprit there. Something definitely sounds wrong though.

    Are you using Mountain Lion or Lion as your OS X version?
     
  12. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #12
    that's the thing that gets me though, there is no swap or page outs used. It's all 10 GB of inactive use, but the second the available free ram drops to around 100mb or less it's as if the inactive ram isn't being allocated to free ram because it starts shutting down to extremely slow levels and pages become jerky and takes forever to render and things like that. So I understand that my inactive ram shouldn't be a problem, but it's almost as if it's not being transferred to active when it's needed, or something like that :p
     
  13. NewishMacGuy macrumors 6502a

    NewishMacGuy

    Joined:
    Aug 2, 2007
    #13
    Your pageouts are low, but with 16GB on light usage to moderate usage, they should be 0.

    How long had you been up and running when that screenshot was taken? A few hours right? Something is wrong.

    Some browsers are known for poor memory management (Safari). I don't use Chrome so I couldn't say for sure, but it seems weird that it's got so many line items on AM. Firefox and Safari have 2 at the most and while Safari has been known to consume/leak gigabytes, Firefox rarely exceeds 500MB.

    You can get Free Memory (in the App Store) to auto-purge for you once you hit a defined lower limit of free memory. I used to use it religiously before I upgraded to 16GB. Haven't needed it since then though.


    ___
     
  14. throAU, Dec 30, 2012
    Last edited: Dec 30, 2012

    throAU macrumors 601

    throAU

    Joined:
    Feb 13, 2012
    Location:
    Perth, Western Australia
    #14
    Inactive RAM = "free" RAM that OS X is keeping the previous contents of until it needs to be properly freed, in case it is needed again.


    All you're doing with "purge" is forcing the issue, and eliminating the operating system's chance of being able to have something already in memory when you try to open something you opened before.

    Page-outs can happen pro-actively when you still have free RAM, if an app (or part of it) has been inactive for a while.

    Page-outs are also likely to be cached in "inactive" memory. The reason for this is that the OS can pro-actively page out BEFORE ram is needed for something else, rather than have to spend time paging stuff out before giving you memory when you need it (slowing things down). If the RAM is paged, but cached in "inactive", the "inactive" ram is just cleared and the page-out is already on disk.

    So, if you have an app that has been paged out and then needs to be paged in, there's a chance it is already paged in, and stored in "inactive" memory, if the memory hadn't yet been needed for something else.

    If you had run PURGE, it would need to be re-read from disk.


    Short story: memory management is a lot more complex than "used" or "not used", and ram that is "not used" in any way is wasted and not pulling its weight.

    Lion perhaps paged a little too aggressively prior to 10.7.4 - possibly because it expected to be run from SSD. Mountain Lion (and 10.7.4) is a lot better in that regard. It's a balancing act between keeping things in RAM "active" and paging them out and keeping them cached or paging them out so the RAM can be used to cache other "hot" data on disk. Original release of Lion got it wrong.
     
  15. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #15
    yeah a few hours and I did a purge and restart after that post and as of now it's back up to 7.5 gb inactive. It's still running fine because I still have about 4 gb free and no page outs at the moment but once that runs low again I will see what happens.

    Edit: Not even watching video or anything and stopped using Chrome for awhile to see what happens. Only using firefox and already down to 3.7 free memory and 7.76 in inactive.

    ----------

    thanks :) again though, I would love to be able to just let OS X do it on its own. But as I've said a couple of times, once my free memory gets low, the multiple GB of inactive memory doesn't seem to move or help in anyway. Once I'm out of free memory my computer just shuts down to crawling levels and starts getting all jerky and stutters etc. until I purge and/or restart. I know the system should be cleaning up the inactive memory on its own when needed, but for some reason that I can't figure out, it does not seem to be doing so.
     
  16. throAU macrumors 601

    throAU

    Joined:
    Feb 13, 2012
    Location:
    Perth, Western Australia
    #16
    I do not see the behaviour you describe. I do not use Chrome (Safari or Opera). Try a different browser?

    It's possible Chrome is being too aggressive trying to maintain its own cache, which is preventing OS X from having the memory available for other things...

    I do not need to run purge, even after running games through steam (borderlands 2), virtual machines in Fusion, etc. I've only got 8gb and no SSD....
     
  17. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #17
    I thought chrome would have been the culprit because I've heard it eats ram sometimes, but I've shut chrome down most of the day and am only using firefox for the last few hours. No games, no movies since my last purge and restart and it still seems to be climbing steadily...
     
  18. throAU macrumors 601

    throAU

    Joined:
    Feb 13, 2012
    Location:
    Perth, Western Australia
    #18
    Inactive RAM will continue to climb irrespective of what you do, as it will be caching things you access on disk (run a virus scanner's "full scan" for example and watch it blow out).

    Free RAM is wasted RAM. If the RAM isn't needed for an active application, OS X (and most other Unix variants) will use RAM for cache.
     
  19. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #19
    thanks :) I understand, but regardless of the logic of what should happen, I'm just saying, once that inactive ram gets up to about 11-12gb or so (which it will shortly probably since it's at 8.4 and still moving) my computer is likely to slow to a crawl once and become basically unusable until I purge and/or restart. Yes I know inactive ram will climb. But what am I accessing that is making it put so much in reserve? I have 3 firefox windows open. no games or videos have been run for a long time now. For having a 16gb system I wouldn't think using email and 3 tabs would have much to cache in reserve in inactive ram. :/
     
  20. throAU macrumors 601

    throAU

    Joined:
    Feb 13, 2012
    Location:
    Perth, Western Australia
    #20
    Oh I get it - but I suspect it is an application issue - an app is either leaking memory or attempting to maintain its own cache rather than relying on the OS to do it (this is one thing Firefox has done in the past)...

    Do you have a virus scanner? My machine won't even fill 7gb of RAM (WAY less) doing a web browser and an email client for hours so I'm a bit surprised that you're seeing that sort of performance problem with that sort of usage...

    And to confirm - you're on Mountain Lion?


    edit:
    Also - javascript can cause memory to be consumed quite a lot depending on the page. Previous version of Safari (5.x) used to leak memory like a sieve if you left it with facebook open...
     
  21. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #21
    I did notice that my utorrent was still open and working on a much heavier transfer load than I've ever had working before. So I closed that out to see if that makes any difference.

    I probably should :p but no I only have a virus scanner at the moment on my windows partition.

    yep :) 10.8.2 I closed out my utorrent. I've used it regularly since I got the computer, but have never run as large file size tranfers as I have the last couple of days. That's the only thing that is different with my usage since I got the computer so I'll monitor everything and see what happens. thanks again

    ----------

    hmm I hadn't considered that. I have menutab pro that runs facebook whenever I click on it. But I've had that going since I got the computer last August and haven't had any problems until the last couple days.
     
  22. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #22
    alright so I think I narrowed it down to my utorrent downloads. I closed that out and reopened all my usual chrome windows, ran youtube and itunes and some other things all at the same time and it stayed down around 600MB of inactive ram the whole time and I had no problems and the second I fired utorrent back up it started to climb again.

    anyways, thanks for all the help and I'll be back if this wasn't it, but I think I got it worked out.
     
  23. Blondie :) macrumors 6502a

    Blondie :)

    Joined:
    May 12, 2010
    Location:
    Prescott, AZ
    #23
    utorrent is definitely a resource hog. Makes sense. Hope that was the issue. Take care
     
  24. fryc86 thread starter macrumors member

    Joined:
    Mar 1, 2011
    #24
    yeah it makes sense and I should have thought of it earlier, I just didn't consider it since I use it on and off pretty much all the time and it never was a problem like this, but at least I figured it out :p
     
  25. throAU macrumors 601

    throAU

    Joined:
    Feb 13, 2012
    Location:
    Perth, Western Australia
    #25
    I highly recommend "transmission" as a torrent client.

    From what you're saying, uTorrent may be trying to cache things (your torrent) too aggressively.... Which makes sense from its point of view actually as it may need the blocks the file(s) are made up of to serve to other users due to the way torrents work...
     

Share This Page