Skip navigation

Massive Mountain Lion memory leak

33440 Views 117 Replies Latest reply: Apr 4, 2014 5:44 AM by Dell Green RSS Branched to a new discussion.
1 2 3 ... 8 Previous Next
imclerran Calculating status...
Currently Being Moderated
Sep 26, 2012 6:17 PM

I will start describing the problem where I first discovered it.

 

My early 2011 MBP had been asleep, and upon opening and waking it, it was incredibly slow. I opened activity monitor and couldn't believe my eyes.

 

I have 8 GB of RAM, and all but 8 mb was in use. Around 6 GB was "inactive". I had no applications running besides Activity Monitor.

 

I opened terminal and ran the purge command After a short wait, total memory usage was back to around 2 GB. Then right before my eyes, over approximately 30 seconds, the "inactive" memory grew until once again, I had about 8 mb of RAM free. This fluctuated a few mb, but nothing significant.

 

After rebooting, I opened Activity monitor again, to watch ram usage. Usage increased to a little more than 2 GB. I then launched the App Store. Before putting my laptop to sleep earlier, I had been downloading a 10 GB update to Borderlands, but had paused the download, and quit the application before closing the laptop. I hit resume download, and went back to Activity Monitor. Memory usage seemed normal for several seconds, but shortly started increasing rapidly again. I imediately hit "pause download" in the App Store. But ram usage continued rising, so I quit the application. It kept rising, until my full 8 GB was in use.

 

At this point I took a screenshot:

Screen Shot 2012-09-26 at 5.52.28 PM.png

 

The only thing I have left to tell you is that before upgrading to ML, I had previously attempted to download the same update, but hadn't had time to download the full 10 GB, so had cancelled the update. That was in Lion 10.7.4, with 4 GB of RAM, and I had no issues.

MacBook Pro, OS X Mountain Lion (10.8.2)
  • Linc Davis Level 10 Level 10 (107,995 points)
    Currently Being Moderated
    Sep 26, 2012 6:53 PM (in response to imclerran)

    Your screenshot shows nothing abnormal. Having a lot of inactive memory simply means that it's been used and released. If you're curious as to what was using it, you'll have to look at All Processes, not My Processes.

  • LousyFool Level 4 Level 4 (2,640 points)
    Currently Being Moderated
    Sep 27, 2012 2:58 AM (in response to imclerran)

    EDIT:

     

    All said to where it belongs.

     

    Other than http://support.apple.com/kb/HT1342 which speaks for itself...

  • LousyFool Level 4 Level 4 (2,640 points)
    Currently Being Moderated
    Sep 27, 2012 3:17 AM (in response to imclerran)

    Thank you very much, apology greatly appreciated, and readily accepted.

     

    You'll have to admit that it sounds like the perfect oxymoron when you state on one hand

    ...it was incredibly slow.

    and

    Besides which, my computer was running at a snails pace at that point.

     

    and on the other hand

    I had no applications running besides Activity Monitor.

     

    Hmmm, nothing running, how do you know it's slow then, anyway?

     

    Whatever, the last thing I worry with OS X is memory management - it's famous for its clever dealing with my Macs' grey cells, and that in mind I couldn't sleep better - since many years.

  • BobHarris Level 6 Level 6 (12,510 points)
    Currently Being Moderated
    Sep 27, 2012 6:38 AM (in response to imclerran)

    Inactive memory is frequently used as an I/O cache.  While I do not know for sure, I think that a lot of the inactive memory may have data that still needs to be synced back to disk (as in disk writes that are cached, and still need to be written to disk).  When other processes need RAM, and inactive memory is used to satisfy the need, the app may nave to wait for slow disk I/O flushing inactive pages before the inactive memory can be given to the requesting app.

     

    Again, I do not know for a fact that Mac OS X keeps cached writes in inactive memory for extended periods of time, however, the slow performance when needing RAM and inactive is all that is available, and considering that laptops consume a lot of power keeping the rotating disk drive spinning, and there are some tasks that update logs on a regular bases that would tend to force a laptop to keep writting to disk, it seems to me that maybe Mac OS X addressed this situation by deferring writes to disk, and using inactive memory to cache it.

     

    The purge command seems to forces Mac OS X to move pages from inactive memory to the free list, and in doing that it would need to flush cached writes to disk, which is why it could take a long time for a purge to complete.

     

    All speculation on my part.

     

    As to Activity Monitor being your ONLY running process, you need to look at ALL PROCESSES in Activity Monitor, as Mac OS X ALWAYS has dozens of background apps running, and if one of them is running away doing lots of I/O, or maybe you have a backup running which will also do lots of I/O, all of which will tend to fill the inactive memory with cached I/O buffers, this could be the source of your growing inactive memory.

  • WillytheKidd Calculating status...
    Currently Being Moderated
    Oct 2, 2012 11:25 AM (in response to imclerran)

    I understand what is being said, but I notice that on my Mac Pro with 20gb of ram, if I start the computer, let it just sit there with only the apps that it uses at startup, come back 2 or 3 hours later and open activity manager, there are times when there has been 8 or 9 gb in inactive memory without ever opening an application.  All i have running on startup (aside from the OS) is Itunes helper, and Dragthing.  What is using that 8 or 9 gb of ram?

  • BobHarris Level 6 Level 6 (12,510 points)
    Currently Being Moderated
    Oct 2, 2012 11:31 AM (in response to WillytheKidd)

    Do you have automatic backups (TimeMachine, SuperDuper or Carbon Copy Cloner, etc... as a schedule regular backup)?

     

    The Inactive memory is used as a cache for program pages and I/O data.  The more the operating system can cashe the less it has to use that old slow clunky rotating disk drive, and the faster Mac OS X can respond to your I/O needs (or that is what it is trying to do).

     

    Also you have background daemons, so you my have been doing network I/O, such as Software Update checking standard program versions to see if there are any new updates that apply to your system.

     

    There could be any number of background activities going on that would be doing I/O when you are not sitting in front of your Mac.

  • WillytheKidd Level 1 Level 1 (25 points)
    Currently Being Moderated
    Oct 2, 2012 1:00 PM (in response to BobHarris)

    Thank you for the response.  I guess what is odd to me is that this did not happen under Snow Leopard.  I have had this happen when I do a safe boot when only the plain OS is supposed to load.  (right)  If I am using the machine, I have never had more than 1 or 2 gb in the inactive area.  I  am just supprised at the amount of ram going to inactive when to me (as far as I know) I am not using any programs which would cause that amount of ram to be cached.

  • ShyLion Calculating status...
    Currently Being Moderated
    Oct 2, 2012 2:14 PM (in response to imclerran)

    I think I was able to nail it down as I have the same issue.  I'm running an iMac that was sold with Snow Leopard and I've updated to Lion then Mountain Lion.  I noticed the memory leak after a week of my upgrade.  After lots of searching and trials, I noticed that if I use Safari to search the web, the inactive memory starts to grow.  And by looking into the activity, it looks like flash applications like facebook causes the problem to exploit.  I noticed later that I had an extension running under Safari which is "FastTube" to download from youtube. 

     

    It seems that FastTube causes some memory leaks through the flash application.  So, I deleted FastTube and since then, my iMac is back on trac.

  • YagoDR Level 1 Level 1 (0 points)
    Currently Being Moderated
    Nov 10, 2012 8:25 AM (in response to imclerran)

    AM.png

    (blue is inactive).
    I've been reading and trying to troubleshoot. Still cannot understand why thei happens. Only Activity Monitor and Safari Running...
    (S)ucks.
    MacBook Pro i7 4GB Ram
  • BobHarris Level 6 Level 6 (12,510 points)
    Currently Being Moderated
    Nov 10, 2012 1:35 PM (in response to YagoDR)

    Do you have a problem, or do you just not like lots of Inactive RAM?

     

    If you do have a problem (performance, or some app will not run, etc...), then start a new thread so you are in control of that thread and can mark it Answered when you feel you have found a solution.

     

    In an earlier post to this thread, I explained that Inactive can be filled from things like backup (TimeMachine, or your own), it can also contain previous run programs that are waiting to be relaunched.

     

    Inactive RAM is RAM that has known information it, for quick reuse, but can also be given up an application needs RAM for code or data that is not already part of Inactive RAM.

1 2 3 ... 8 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (3)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.