Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CodeBreaker

macrumors 6502
Original poster
Nov 5, 2010
494
1
Sea of Tranquility
My Mac starts paging heavily even after a fresh restart. And I have no idea where the memory is going (Lion??). Anyways, I have attached the Activity Monitor screenshot. There is very less inactive memory and more than 5 GB active memory, but there are no running apps that are eating RAM.

J7z8qE


I thought the RAM is faulty, but I'm using it since 4 months (on both SL and Lion), and I also ran memtest to confirm. I use Xcode, Safari, Mail, iChat, LimeChat, iTunes and occasionally Photoshop at work. But I quit them before coming home. Somehow Lion doesn't free that memory.

So is there a way to get back my RAM, apart from a reboot?

Specs: MB 5,1 (2.4 GHz), 8 GB RAM (OWC), OS X 10.7.2
 
Last edited by a moderator:
Page outs are cumulative since your last restart, so the best way to check is to restart your computer and track page outs under your normal workload (the apps, browser pages and documents you normally would have open). It might be helpful to keep the Activity Monitor window open, to see the exact point where you start paging. It may be a particular app that consumes RAM for a brief period, then releases it.
 
Activity Monitor is of no help to me … I tried to monitor the processes for around 3-4 hours, but none of them, at any given point use more than 700 MB RAM. The output of the ps command (summing up real memory from all active processes) is never more than 2 GB, but my OS is reporting > 5 GB active.

I believe this is because the OS caches frequently used apps in the active memory. But in that case, it should use that RAM when I relaunch those Apps. But that does not happen, the OS just allocates more RAM, which results in paging. And so my swap file increased to about 1.2 GB from 550 MB, after 3-4 hours, when I launched just those Apps that I had quit.

It's like a huge chunk (~3-4 GB) of my RAM has suddenly become useless. I think I should use Instruments/DTrace for this. Now reading about the D language...
 
I finally found the culprit -- none other than Xcode. I used Instruments to monitor it and found out that the darn thing allocated more than 5 GB RAM in less than 2 hours of use. :eek:

And I was blaming Safari all these days! Seems to be a wide spread problem with no solutions since Xcode 4.0.
 
I finally found the culprit -- none other than Xcode. I used Instruments to monitor it and found out that the darn thing allocated more than 5 GB RAM in less than 2 hours of use. :eek:

And I was blaming Safari all these days! Seems to be a wide spread problem with no solutions since Xcode 4.0.
Yikes! I didn't realize Xcode used that much RAM when it was running. Maybe there's a memory leak somewhere Apple didn't spot? ;)

This makes me glad I use Xcode infrequently and that I have 16 GB of RAM.
 
Yikes! I didn't realize Xcode used that much RAM when it was running. Maybe there's a memory leak somewhere Apple didn't spot? ;)

This makes me glad I use Xcode infrequently and that I have 16 GB of RAM.

Too bad I am an iOS developer. The only solution for me is to restart Xcode every hour. As for Apple, well, they somehow ignore memory footprints of their products -- Lion, Safari, Xcode, …
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.