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

vmflapem

macrumors 6502
Original poster
Dec 27, 2013
422
67
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?
 

augustya

macrumors 68030
Feb 17, 2012
2,831
379
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?
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 !
 

vmflapem

macrumors 6502
Original poster
Dec 27, 2013
422
67
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 !
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)
 
Nov 28, 2010
22,668
27
located
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)
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
Random Access Memory (RAM) is the "working memory" in a computer. Additional RAM allows a computer to work with more information at the same time which can have a dramatic effect on total system performance.
 

raptor402

macrumors 6502
Jun 30, 2011
399
2
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?
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
 

augustya

macrumors 68030
Feb 17, 2012
2,831
379
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.
 

vmflapem

macrumors 6502
Original poster
Dec 27, 2013
422
67
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 :)
 
Nov 28, 2010
22,668
27
located
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?
Yes. 16 GB RAM should be more than enough for running multiple applications with lots of tabs.
 

vmflapem

macrumors 6502
Original poster
Dec 27, 2013
422
67
Yes. 16 GB RAM should be more than enough for running multiple applications with lots of tabs.
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?)
 
Nov 28, 2010
22,668
27
located
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?)
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.
 

vmflapem

macrumors 6502
Original poster
Dec 27, 2013
422
67
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.
Ahh just what I needed to hear. You are the best xD
 

Intelligent

macrumors 6502a
Aug 7, 2013
924
2
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?
RAM works exactly like it does on any other computer.
 

Nermal

Moderator
Staff member
Dec 7, 2002
18,678
1,183
New Zealand
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.
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.
 

dusk007

macrumors 68040
Dec 5, 2009
3,383
61
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.
 

vmflapem

macrumors 6502
Original poster
Dec 27, 2013
422
67
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
 

TheEnthusiast

macrumors regular
Aug 22, 2013
146
3
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
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.
 

vmflapem

macrumors 6502
Original poster
Dec 27, 2013
422
67
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.
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 :)
 

rex450se

macrumors regular
Apr 9, 2011
209
43
Independence, MO
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.
 

Attachments

Weaselboy

Moderator
Staff member
Jan 23, 2005
29,169
8,822
California
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 :)
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.

To account for the more dynamic nature of how RAM is used in OS X, Apple has changed its memory chart to show usage in terms of a "pressure" concept. To visualize this, consider the RAM to be a tank of compressed air. As the system's activities use more RAM, more air is shoved into the tank so the pressure goes higher. As even more RAM is used, the higher pressure eventually reaches a threshold that triggers the system to write unused portions of it to disk, or force unused programs to close. As this behavior starts, the green color of the pressure graph will turn to yellow and then to red, indicating the system's RAM usage is less efficient and to optimize performance you will need to either get more RAM, or quit programs and otherwise reduce your RAM usage.
 

vmflapem

macrumors 6502
Original poster
Dec 27, 2013
422
67
Thanks!
This concept is extremely clear to me now.
8GB RAM would be wayyy more than enough for my usage :)
 

scaredpoet

macrumors 604
Apr 6, 2007
6,626
342
Thanks!
This concept is extremely clear to me now.
8GB RAM would be wayyy more than enough for my usage :)
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.
 

dusk007

macrumors 68040
Dec 5, 2009
3,383
61
Well for starters I'm on 10.8 and have therefore never seen this "RAM pressure" thingy :)
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.

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.
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.
 

leman

macrumors G3
Oct 14, 2008
9,977
4,555
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.
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