Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

The Inactive RAM / Memory Management Thread

It's time to get to the bottom of this "inactive RAM" issue. I've heard lots of complaints about it, and I have suffered from it myself. Sometimes, it chews up all the free RAM and leaves my system crawling and paging out a lot. This often happens when I open VMWare Fusion, but it can also be caused by certain third-party background programs like Little Snitch.


Many have said that it's essentially free RAM because it can be immediately used when needed, and others have also said that having lots of used or inactive RAM isn't necessarily bad because it means that the system is optimizing. This isn't really true. When the problem with inactive RAM occurs, the system refuses to use it and instead starts paging. This causes a massive slowdown. So, first of all, the inactive RAM is NOT free, and secondly, the system's memory optimization is going horribly wrong when this occurs.


Apple really should fix this, and if you experience it, you should leave them feedback... Mavericks still seems to have the problem. But for now, I'll list the partial solutions to this. Hopefully others will reply with more information:


- Try downloading EtreCheck to check for third-party launch items so you can go in and remove them. It's a preventative solution that worked for my friend. But if you use VMWare Fusion, which is known to cause issues...


- The "purge" command will free up all the inactive RAM, but it only works in Lion and earlier.


- FreeMemory frees up inactive RAM but takes longer than purge. Unfortunately, it's only available on the App Store (at least it's free), and I can't download it anymore for some reason. I went to it on my App Store, and the window strobed black and white for 30 seconds then gave me an error.


- Someone found the source code of Apple's pager, edited it, compiled it, and installed it on his system. Uh, nobody wants to do that, but if you're nobody, check it out. Seriously though, I don't recommend this, especially since it's a really old article.


- You can disable paging, which will force the system to use the inactive RAM, thanks to this answer! Though it has the weird side-effect of making a large fraction of your RAM appear as "wired", it seems to speed up the system and seems to be the best fix. It passed the VMWare Fusion test. If you dare, run "sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist" (no quotes) in Terminal, then reboot. You can undo this using "sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist" (no quotes) then rebooting.


Now that I've disabled the paging, I'll reply if there are any updates.

Posted on Mar 25, 2014 5:17 PM

Reply
4 replies

Mar 28, 2014 6:48 PM in response to AlecZ64

Since Mountain Lion is now the "Previous" operating system, and Apple has made major changes to memory management in Mavericks, I do not think they are going to do anything to Mountain Lion memory.


NOTE: I have come to the conclustion that Inactive RAM tends to contain dirty data that needs to be written to disk before it can be used for another purpose. Some of this Inactive RAM is modified data of an application, which will then be paged to the /var/vm/swapfile(s), and some of this Inactive RAM is the file system cache with data written to a file, but no yet written to disk, which needs to be written before the RAM can be used for something else.


I Mac OS X allows Inactive RAM to collect dirty data is a result of perserving battery life on the Macbooks, as constantly doing writes to disks, such as flushing logs that get updated on a regular bases, would keep the disks spinning almost constantly, which is very power consuming.


This is why I suspect that when Free RAM is low and apps make heavy demands for RAM, this triggers heavy slow disk I/O. It is also why Macs with Solid State Disks tend to not be as strongly affected, as their I/O is so much faster.


I also think that Apple's move towards more and more Solid State Disks, is how they are going to side step the Inactive RAM issues. That and in Mavericks, they do not mention Inactive RAM any longer. Now there is "App Memory", "File Cache", "Wired Memory", and "Compressed". Inactive is no longer reported, unless you are willing to use Terminal command line tools.

Mar 28, 2014 7:13 PM in response to BobHarris

Thanks for your hypothesis about the inactive RAM. Now that you say it, it seems like that's what is going on. And that means that VMWare Fusion and other problematic programs are somehow creating lots of "dirty RAM", and the system isn't handling the problem well when it starts running out of free RAM.

BobHarris wrote:


I also think that Apple's move towards more and more Solid State Disks, is how they are going to side step the Inactive RAM issues. That and in Mavericks, they do not mention Inactive RAM any longer. Now there is "App Memory", "File Cache", "Wired Memory", and "Compressed". Inactive is no longer reported, unless you are willing to use Terminal command line tools.

Heh, well I was hoping they'd fix it instead of hiding it 😉

Mavericks seems to still have inactive RAM, which can be reported by something like iStat Menus. When you look in Activity Monitor and see "memory" and "real memory", there's sometimes a large difference between them, and I think the difference is inactive memory. As far as I could tell during my month of Mavericks before I went back to ML, the inactive RAM problem still occurs sometimes.

The Inactive RAM / Memory Management Thread

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.