Can someone explain when 'RAM' is used on MacBooks?

Discussion in 'MacBook Pro' started by vmflapem, Jan 24, 2014.

  1. vmflapem macrumors 6502

    Joined:
    Dec 27, 2013
    #1
    OK so I have no idea how this "RAM" thing works on Macbooks.

    I opened an internet tab using chrome and some finder folders and the system says I'm using 4.10GB RAM.
    I used a Vaio laptop before and it only had 4GB RAM, which I had no problem with.

    How and when is RAM used? Does it use RAM memory if I, for example, open 100 finder folders?
     
  2. augustya macrumors 68000

    augustya

    Joined:
    Feb 17, 2012
    #2
    Everytime and all the time ! Always even if you open a browser window it uses RAM without a RAM it is like saying I have a car when does it uses engine ! All the time ! Yes Even with Finder !
     
  3. vmflapem thread starter macrumors 6502

    Joined:
    Dec 27, 2013
    #3
    Ah.. OK I think I kinda understand.
    But does MacBook Pros use more RAMs than Windows laptops in general? Because I've been using a 4GB RAM Windows laptop for 4 years and I've never seen it go over that limit (assuming that the laptop shuts down if I go over limit)
     
  4. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #4
    The computer does not shut down if it needs more RAM than available.
    If more RAM than available is needed, content no longer in use is being copied to the storage device (HDD or SSD) to make room for the new stuff.
    That is called "paging out", which sometimes gives you delays in your computer experience.

    If you have 8 GB of RAM, let it get used, no need to have free RAM.


    What is RAM? - measured again in MB and GB
     
  5. raptor402 macrumors 6502

    Joined:
    Jun 30, 2011
    #5
    If you mean why you're using so much RAM, the answer is simple: application cache. If you open Activity Monitor and go to the Memory tab, you'll notice suff like Physical Memory and Memory Used. That's just what it sounds like. If you look to the right, you'll have more stats: App Memory, File Cache and Wired Memory. App Memory is your actively used memory. That's where Chrome, Finder and all your other apps reside. File cache is a temporary cache generated by your running Apps and Apps that were recently running. You can clear it with the terminal command "sudo purge". Wired memory is stuff that has to be saved on the RAM because it can't be shifted to the HDD.

    Regards
    Raptor
     
  6. augustya macrumors 68000

    augustya

    Joined:
    Feb 17, 2012
    #6
    You are talking about making some comparison tests here not sure If I have data to comment on it. Maybe some others can chime in.
     
  7. vmflapem thread starter macrumors 6502

    Joined:
    Dec 27, 2013
    #7
    Thanks everyone :)
    So just to make sure, if I have a 16GB RAM, does that mean that I can have multiple dashboards runnings and don't really have to worry about closing any windows/browsers at all?

    Edit: meant to say "mission control"; not dashboards :)
     
  8. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #8
    Yes. 16 GB RAM should be more than enough for running multiple applications with lots of tabs.
     
  9. vmflapem thread starter macrumors 6502

    Joined:
    Dec 27, 2013
    #9
    Thank you!
     
  10. vmflapem thread starter macrumors 6502

    Joined:
    Dec 27, 2013
    #10
    Sorry, but let me ask one more noob question.
    Does RAM get cleared automatically if I close those apps? (i.e. is it temporary, rather than permanent, storage?)
     
  11. simsaladimbamba

    Joined:
    Nov 28, 2010
    Location:
    located
    #11
    It is temporary, but if you quit an application, it is not cleared from RAM until more RAM is needed, in the event of you having to re-open that application.
    Mac OS X takes quite good care about RAM usage, do not worry, if that is why you ask. 16 GB is more than enough for your stated needs.
     
  12. vmflapem thread starter macrumors 6502

    Joined:
    Dec 27, 2013
    #12
    Ahh just what I needed to hear. You are the best xD
     
  13. Intelligent macrumors 6502a

    Intelligent

    Joined:
    Aug 7, 2013
    #13
    RAM works exactly like it does on any other computer.
     
  14. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #14
    Just to expand on this a little: Compared to other storage methods, RAM is extremely fast. OS X therefore keeps as much in RAM as possible, to keep the system running quickly. Even if you quit an application it'll stay in RAM for as long as possible so that if you start up the app a second time it'll come up quickly.
     
  15. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #15
    Why does nobody bother to look at the RAM pressure that has been added in OSX 10.9 Mavericks? It tells precisely about what is of interest in this thread. Is there enough RAM or not. If RAM pressure is low there is plenty of room to play with if it is high I guess it would change color and then paging might occur.
    I thought that feature would kill such threads but not even one reply seems to mention it.
     
  16. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #16
    Well for starters I'm on 10.8 and have therefore never seen this "RAM pressure" thingy :)
     
  17. vmflapem thread starter macrumors 6502

    Joined:
    Dec 27, 2013
    #17
    OK so currently, I'm not running that many apps, but my memory used is 4.50GB out of 8.00GB.
    Shouldn't that make my RAM pressure reach 50%? It's only at like 1/7 its maximum pressure according to the activity monitor.

    If my casual RAM usage was 5.50GB maximum, do you think that 8GB RAM would be enough for me? I don't do any video editing, photoshop, or anything along that line, but I do download stuff a lot
     
  18. TheEnthusiast macrumors regular

    Joined:
    Aug 22, 2013
    #18
    I'll explain briefly, without the technical details. You are not actively using 4.50GB of RAM in all likelihood. Even if you were, 4.5/8GB does not mean >50% memory pressure.

    There is some documentation about this, "Memory pressure is defined by two counters Mach keeps internally: vm_page_free_count: How many pages of RAM are presently free vm_page_free_target: How many pages of RAM, at a minimum, should optimally be free," but I'm not getting technical, as I said before. Memory pressure is essentially a process that's responsible for detecting when memory is low, meaning when "free" memory is no longer available and then the OS has to start swapping, i.e writing data from memory to the SSD/HDD and vice-versa. Moderate swapping is indicated by a yellow-orange color and heavy swapping is indicated by red.

    How did you get that roughly 6GB of RAM for causal usage? :eek: Based on what you described (no photoshop, video-editing), you'd even be fine with 4GB of RAM. Also, downloading a lot doesn't affect RAM usage.
     
  19. vmflapem thread starter macrumors 6502

    Joined:
    Dec 27, 2013
    #19
    Thanks a lot!
    I was just freaking out a bit because I used to have a Sony laptop with a 4GB RAM, and I never had any problems. But yesterday when I checked my RAM usage on my Macbook it was using 5.50GB and I guess most of it was for inactive apps.
    Based on your explanation, it looks like memory pressure is what really matters rather than the number itself. I will just stop worrying about running out of memory on my 8GB Macbook :)
     
  20. rex450se macrumors regular

    Joined:
    Apr 9, 2011
    Location:
    Independence, MO
    #20
    If it's there the computer will use it. And as long as you aren't doing anything labor intensive you won't notice how much is being used. Now if you start to really push the system you might notice when it pages out. Just to see what I was using I opened Activity Monitor and noticed I'm using almost all of my 16 GBs. Currently I only have Safari with about 15 tabs open, iTunes and another program running in the background. If the RAM is available the computer will put it to use.
     

    Attached Files:

  21. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #21
    Exactly. There is a good article here that explains it a bit.

    The below excerpt from the article has a good analogy of how RAM pressure works in Mavericks.

     
  22. vmflapem thread starter macrumors 6502

    Joined:
    Dec 27, 2013
    #22
    Thanks!
    This concept is extremely clear to me now.
    8GB RAM would be wayyy more than enough for my usage :)
     
  23. scaredpoet macrumors 604

    scaredpoet

    Joined:
    Apr 6, 2007
    #23
    Yes it would. But bear in mind that if you're using Mavericks (the latest version of OS X), it will gladly make good use of any RAM that you have, be it 4, 8, 16, or 32GB. When possible, spare, "unused" RAM can be used for things like file caching and other methods to speed up access. The idea is that if you're paying for the RAM, OS X will give you your money's worth and put it all to use.

    This is part of why you're seeing "so much " of your RAM being used on your Mac Laptop. The RAM is there, and so OS X is going to make itself comfortable. :) But if you only had 4GB, chances are it would be just as fine there too. This is NOT a behavior in Windows as yet, so, If you have 8GB, then the RAM unused RAM just sits there, not used for anything.

    Of course, if it turns out you need that extra RAM for actual application usage, it will clear out the caches and make room as needed.
     
  24. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #24
    I suppose that explains it. But it is a free upgrade and unless you run an old notebook which works better with 10.6.8, I see no reason not to upgrade.
    It is a very neat little feature because it actually tells you what you need to know and not give you a bunch of numbers most people don't know what to do with. A developer might need the exact numbers but usually only for a specific process.

    Windows does the same thing it even actively prefetches stuff when an algorithm thinks there is any benefit to it, and memory can be assigned different priority levels so the OS knows which it can purge or page out first and which to prioritize.
    Windows devides into available memory and in use, which is fairly easy to understand. Just because memory is available in Windows doesn't mean it is free. It is just used for caches or anything not to important and can be freed up if needed.
    Windows just in general needs less RAM because since Vista they optimized it to run on worse and worse hardware (netbooks, tablets) and it got more efficient form 7 to 8. OSX had a different journey with only Mavericks making any turn for the better at all. Hardware massively faster and 8GB is now even standard on notebooks, so no reason to do anything about it. Windows 8 has to run on baytrail tablets with 2GB RAM and should do so well. Since 10.6 it just got worse and worse. The biggest memory hog in OSX are applications which just seem to use more memory than their direct Windows counterparts in many instances. It is probably the frameworks used that just make extensive use of memory space.
     
  25. leman macrumors 604

    Joined:
    Oct 14, 2008
    #25
    Exactly. The programming model of OS X is very RAM-intensive because it involves tons of abstractions. Makes programming for it a pleasure though :D
     

Share This Page