Mac OS X devouring memory

Discussion in 'OS X Mavericks (10.9)' started by grandM, Apr 6, 2014.

  1. grandM, Apr 6, 2014
    Last edited: Apr 6, 2014

    grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #1
    I really do not understand why macOS needs so many ram memory. On booting it required 3 GB or so. That's cool.

    I ran Xcode and iOS Simulator. Both programs are shut down (force stop). And now macOS is using over 7 GB of ram. Why?

    I took a screenshot as proof. I've also let activity monitor create a pdf.
     

    Attached Files:

  2. jpeezy macrumors regular

    Joined:
    Feb 24, 2010
    #2
    It's inactive or cache. Open terminal, type "sudo purge" without the quotes. FYI, unused memory is wasted memory.
     
  3. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #3
    Mavericks pretty aggressively tries to use available memory to cache data and files for faster access. You are fine and this is normal. As long as that colored "memory pressure" line at the bottom is green, you have plenty of memory.

    Give this article a look.
     
  4. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #4
    Well I was just surfing the internet and I read a lot of people complaining. It's a bit strange to see 8 GB of ram chewed up while having nothing running. I do appreciate the purge idea but one can't sudo purge every hour. I had already noticed once that mavericks was using up 15,6 GB of the available 16 GB and it did concern me. Is there a way to force Mavericks not to use for example 2 GB for caching files? I have a hunge that this full ram running might splash into my face. On the other hand if macOS did it right it would indeed be no reason to worry at all. Swap is zero. Lol but seeing memory builds really concerns everyone learning to program...
     
  5. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #5
    I don't know of any way to restrict Mavericks fem doing this. It really is nothing to worry about. If that RAM is needed for another app, Mavs will free it up and reallocate.
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    In your posted case, Xcode and iOS Simulator are still in RAM. The OS is keeping them cached. The cost for this is zero: the programs are already resident in RAM because they were being used. There are no requests that need the RAM they occupy, since there's still another 9 GB of unused RAM (you have 16 GB). Hence, there is no logical reason for the OS to simply abandon the cached data.

    You also have 0 bytes of swap being used, and 0 bytes compressed (gecomprimeerd). So no paging has occurred, and there has been no demand to move any page out of RAM (the first demands will compress, further demands will swap). Swapping is the most detrimental to performance, but its effects are cumulative (small swap is not a big detriment).

    The purpose of caching is to keep something available quickly, so it doesn't need to be retrieved from a slower source. If the OS abandons cached data simply to have free RAM, then there is no caching, and performance suffers. Here, there's still at least 9 GB of free RAM available for other processes before the OS has to uncache anything.

    If you're a programmer, you should review the hierarchy of how virtual memory, caching, and swapping works. If you don't know what those are, look them up on Wikipedia.

    In any case, read here for what Activity Monitor's "memory pressure" means:
    http://support.apple.com/kb/HT5890
     
  7. hiddenmarkov macrumors 6502a

    Joined:
    Mar 12, 2014
    Location:
    Japan
    #7

    As mentioned caching and memory loading is by design. A common statement in IT (to include programming) is you can either pay the piper now, or pay the piper later. With caching and memory loading you get the payment out of the way upfront. Apple can't really win here so chose the lesser "evil". If no caching its reload every app start up. Which for most users is a greater evil. As most tend to fire up the same apps.


    What you are looking if it exists may not be what you actually want. If you tweak you system to do this you won't be emulating what your client(s) will have. All later macs will have cache/memory pressure. they aren't running xcode granted. they are running office apps, chat/im, games, etc cached. Different paths, same destination really.



    For your needs you would actually want to have test systems. Virtual or physical if you can. I do virtual's myself. Not saying you have to do this but as someone learning code myself I find vm's (I can't afford physicals myself) to be of great help. A fresh start mac os vm is nice baseline. Or linux ones I run as I do perl/python and look for portability. In terms of what you are looking for you get a much cleaner resource usage monitoring ability.
     
  8. FreakinEurekan macrumors 68040

    FreakinEurekan

    Joined:
    Sep 8, 2011
    Location:
    Eureka Springs, Arkansas
    #8
    People like to complain. Weaselboy is exactly right, it's normal and nothing to be concerned with.

    [​IMG]
     
  9. bobr1952 macrumors 68020

    bobr1952

    Joined:
    Jan 21, 2008
    Location:
    Melbourne, FL
    #9
    Mostly people who don't understand Maverick's memory management. Apple added memory pressure and color coded it so that users could easily see how stressed their memory usage is. And in your case, memory usage is very low.
     
  10. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #10
    Agreed, free memory is wasted memory and Weasleboy is spot on as usual. OP, as long as the memory pressure in the activity monitor is not in the read you're ok.

    If you're overly concerned reboot and that will reset everything.
     
  11. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #11
    No it's alright
    I understand what apple's up to
    TX
     
  12. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #12
    It is the complete opposite to how windows handles memory, so when you see free ram on windows take a dive you know you need to do something, but for OSX, free ram is wasted ram :)
     

Share This Page