Where is my RAM?

Discussion in 'macOS' started by CodeBreaker, Dec 26, 2011.

  1. CodeBreaker, Dec 26, 2011
    Last edited by a moderator: Dec 26, 2011

    CodeBreaker macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #1
    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.

    [​IMG]

    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
     
  2. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #2
    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.
     
  3. CodeBreaker thread starter macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #3
    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...
     
  4. CodeBreaker thread starter macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #4
    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.
     
  5. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #5
    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.
     
  6. CodeBreaker thread starter macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #6
    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, …
     

Share This Page