Memory Pressure and How Your Mac Uses Memory

Learn how your Mac uses memory and makes it seem like you have more memory than you actually do by compressing and swapping memory. Learn what Memory Pressure is and how you can use this measurement to improve performance in extreme situations.
▶ You can also watch this video at YouTube.
▶ Watch more videos about related subjects: Hardware and Accessories (14 videos).

Video Transcript

Hi, this is Gary with MacMost.com. Let's talk about memory pressure and how your Mac uses memory.
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to MacMost.com/patreon. There you can read more about the Patreon Campaign. Join us and get exclusive content and course discounts. 
So first let me start off by saying that most Mac users don't need to worry about how their Mac uses memory. Just use your Mac to get your work done or play your games or do whatever it is you do on your Mac. Unless you're having a problem and you want to try to diagnose it you don't need to pay much attention to how your Mac uses memory. But if you are curious you may have looked into it and you may have heard terms like memory pressure. Let me explain what that is. 
To check how much memory your Mac is using run Activity Monitor. I'll launch it here with Spotlight. Then you want to switch to Memory here at the top. Now it may take a few seconds for things to appear here but after a little while you'll see all of the apps and things you are using listed and you'll see how much memory they are using right here. You can Sort by memory. So this app is using the most memory. My Screen Recording app right now. Note here it tells you which user is using this. If you have multiple users on your Mac you might want to go to View and then switch to All Processes instead of just My Processes. Now you're going to see all the different users. So you see the main user here and my Demo Account user and you're going to see the System and what's using the most memory. In addition here at the bottom you're going to see Memory Pressure. You're also going to see some other things here as well. At the top you'll see Physical Memory. I'm using my M1 MacBook Pro which has 8 GB of RAM in it for this demonstration. 
Now memory used, in this case, 5.71. So it's not using all the memory. It will show also Cached Files here. So what your Mac does with used memory is it will take the files that you are most likely using right now, or soon, and actually cach them in memory. So if you open up a document, say that you're opening up all the time, instead of having to go to the drive to get it it's actually in memory. This speeds up your Mac quite a bit. Swap used is how much of your storage, your SSD, is being used as memory right now.  I'll talk more about that in a minute. Now you're going to see here that memory used is broken up into three different things. App Memory is the memory used to buy the apps that you have running. So they'll each ask for a bit of memory and the system will give them that memory. Wired Memory is mostly System memory. So the operating system itself is using this memory. Compressed is memory that's being used by apps but the system has determined that it is not being used right this second so it can be compressed into a smaller space and take up less of the total physical memory. 
Now before I dive down into each of these and talk about memory pressure it's important to note that the amount of memory you use to buy apps and by the System itself will vary depending upon how much you have available. So just because an app is using say 1G of memory doesn't mean it needs to use 1G of memory. The app and the system negotiate and the system gives it that much memory. Now it may be that the app can perform perfectly well with half or even a quarter of that memory. But free memory doesn't help you at all. It's there. It's powered up. But it is not being used. So, the System is going to want to use it. So if an app can be a little bit faster or a little bit more efficient by using the memory the system won't give it that memory. A lot of people make this mistake. They look here in Activity Monitor and see, wow I'm only running a few apps. It's no big deal and all of my memory is in use so obviously I can't run anything else. My System is maxed out. But that's not how it works. You can probably run a lot more, as I'll demonstrate later, and the System will adjust. As a matter of fact my main machine is MacStudio with 64 G of RAM and just by starting it up and running some basic apps I'm using more than 8G of memory. So you would think that logically I could never run those same apps on this 8G MacBook Pro. But, in fact, of course I can plus a lot more. The system is going to behave differently when it knows that it has limited memory as opposed to having a ton of extra memory. The difference may not even be noticeable by you. Apps seem to run at almost the same speed. So it is important to remember that one thing. The system does not like unused memory. It will try to use it for whatever it can to make things a little faster and a little more efficient. So don't worry if it always seems like you're using almost all your memory. You should be.
Alright. So now back to Memory Pressure. Your Mac actually uses memory three different ways. One is to simply use memory as normal and that's when you are not using all your memory. When you do that memory pressure will be low. This chart here shows you memory pressure over time. So on the right is the current amount of memory pressure. If it is toward the bottom and green that's excellent. That is the best case scenario. That means it really doesn't need to do anything special for you to do everything you're doing right now. The memory you've got is plenty. Now your Mac has two tricks to make memory go further. One is to Compress memory. So say you're using several apps. Maybe you're using iMovie, Mail, and Safari and iMovie is using a lot of memory. But currently you are using Mail. You're actually answering some emails. One of the thing your Mac may do is take the memory used by iMovie and compress it. By compressing it, just like compressing a file to make it smaller, it can use less memory. A lot of times it can compress it quite a bit because some of that memory isn't being used at the current time. It has allocated a bunch but it's empty righty now just waiting for you to do something. Render a video, add another clip, that kind of thing. So it compresses it. Now to switch back to iMovie it needs to uncompress it. It does this super fast and you won't even notice it. But by compressing it, it can make the 8G of RAM actually seem like a lot more. So if it needs a little bit more than what you've got now it will simply compress. That's where you see Compressed right here. It's compressing what it doesn't need to access right now. But that is still in RAM. It's still in memory just compressed now. 
If it is actively compressing and decompressing memory, the Memory Pressure Chart will show yellow instead of green on the right and you'll see it kind of in the middle there. That means it's actively compressing and decompressing and that's fine. It's still working great and you probably not going to notice any difference between that and when it is all green.
Now the second trick your Mac has is to use your storage as memory. This has been a standard technique for decades and it's called Swap now. It basically takes a piece of your SSD and stores some of the memory there temporarily so the stuff you're not using right this second and will swap it in and out between memory and your SSD. Fortunately, SSD's are fast. Way faster that hard drives used to be when we had virtual memory. Apple drives are even faster than most. So the swap can happen pretty quickly and you could still get along using your apps. You may notice a little bit of lag or slowness but things still work. When you're using a lot of swap, so compression isn't enough for the apps you're using and it needs to use the SSD to store memory, then you're going to see your Memory Pressure now up in the red. When it is in red it's using the SSD for memory. Now if it does that here and there you may not even notice. If it continuously remains in the red you're probably noticing that your Mac is running slower. 
Now let's try out live. I'm going to leave this right here. I'm going to launch some apps. Let's launch Safari and let's go to a webpage. Let's open another tab and go to another webpage and another tab and another and I'm just going to keep opening pages. Alright. So you can see I've opened 15  tabs now in Safari. Some of them are YouTube tabs actually showing videos. You can see how the memory pressure is increased. If you look here we can see there's more memory used, more app memory being used, more that's compressed. I only have one out of these 15 tabs actually showing. It's still not using any Swap so my 8 G of RAM is handling this fine. It's not caching as many files right now because it doesn't have as much free memory available. 
Now let me launch some other apps. So I can see I'm in yellow here. It's definitely compressing a lot back and forth. You can see which is using the most of my memory.  It's actually some tabs here in Safari. Maps is using a bit and all of that. I don't actually notice any problems here. If I want to switch to different apps I can do it and it doesn't really seem to be slow or anything like that. I can create a new document, for instance, here in Pages and it creates it rather quickly and I scroll around through it. It works fine. So memory compression is doing its job. It is allowing me to basically use a lot more on my Mac than I normally would be able to do with 8G of RAM.
Now it is actually hard for me to get above yellow into red. So let me really try to push it by opening some more Safari tabs. Alright, so at this point I've got 30 or 40 tabs open in Safari. Most of them playing YouTube videos. I've got Pages open with a document that is huge. More than a billion words. Numbers also has a huge document of random numbers that I have created. So you can see I'm really pushing things. I've hit red a few times and I'm really high up there in yellow. You can see how much Swap is being used. So things are still pretty good. I can still switch between apps pretty easily and use things pretty well. Now let's calm things down a bit. Let's go into Safari here and Quit Safari. So all those tabs are gone. That's going to get rid of a lot of this. You can see it disappears. You can see everything drops right down into green. So I still have all of these different apps running thanks to the techniques of using Compressed Memory and Swap. My 8G Mac is able to handle it pretty well. 
The question you may still have is what is Memory Pressure. What exactly is that measuring? So that is actually measuring how well your Mac is handling the demand for memory by the System and apps. When it is green it means it doesn't need to use any special techniques like Compression or Swap to do everything that you need. When it is yellow that means it is using its first technique, Compression, in order to do everything that you need and you may notice the slightest bit of slowdown. But probably not. When it is red it means it is heavily using Swap to also deal with your need for memory. Now momentarily being red shouldn't really be noticeable. As a matter of fact sometimes when you launch new apps, you're doing a bunch of things when you launch them, and you might see a spike in the red and it drops down. That's normal. It is when it reminds red that you'll probably see a slowdown and things getting really laggy. So memory pressure isn't measuring anything specific like an actual number, like the amount of memory being used or something like that. It's actually measuring activity that your Mac is doing to deal with memory. 
Now I'm going to tell you the most important thing. How can you use this information?  If you see your Mac green or yellow there's probably nothing you need to do. If you see it in the red and you notice there's a problem. That it's lagging. Then you need to do something. But, what do you do? Apple itself often states this is an indicator that you need more RAM. But unless you have a MacPro you can't really add more RAM to your Mac. A lot of blog posts and other videos out there will say the same thing. This is an indicator you need more RAM. Well, you can't add more RAM. I think a lot of that information goes back years when it was possible to add more RAM to various Mac models. Maybe that same information is being regurgitated over and over again. Shows maybe a lack of research on the actual subject and just rehashing what has already been said. 
So if you can't add more RAM what can you do? Well, if you notice your Mac is lagging then you go to Activity Monitor and look in Memory and you notice Memory Pressure is sometimes hitting red or constantly in red what you can do is take this as an indication that you need to do less at one time. Notice how I had to do a lot of things on my 8G MacBook Pro to even get close to red. Well if you're doing a lot of things and things seem slow then it indicates that you may need to quit some apps or close some tabs in Safari. Look in the list and if you see an app that's taking up a lot of memory but you're not using it right this second maybe close it. Maybe you've got a Messaging app open and notice it is using a lot of memory but you're trying to work with video in Final Cut right now. Well, then quit that Messaging app. Work with the the video in Final Cut and when you are done go back to the Messaging app. In other words you've got to make sacrifices. You have too many memory hungry apps or browser tabs open at the moment and you've got to cut back a little bit to get things done right now. It's really not anymore complex than that. Just take a look at the list and see what's going on. For instance if I was having a problem here I might notice that Pages, iMovie, and Numbers are all using a lot of memory right now and maybe I'm only working in Pages. iMovies is a project that I was working on this morning and I want to get back to it later. But maybe for now I'll quit iMovie. None of these things are true right here and everything is working great but as an example you just want to look at things at the top of this list when sorted by memory use and see what you don't necessarily need to have running at the moment. 
Another thing to look at is to make sure you have enough storage. Remember that Swap uses your SSD for memory. So if your SSD is almost full it has less to work with. If you have a drive that is 90 or 95% full then that last technique, Swap, won't work as well. If my Mac is ever slow the very first thing I ever check is Storage not memory and make sure that I'm almost maxed out on storage. Get rid of some files. Archive some stuff. Delete some files. Delete some apps and clear out some space. Then your Mac's memory technique of Swap may be used more efficiently.
Hope you found this useful. Thanks for watching. 

Comments: 10 Comments

    Eric
    3 years ago

    An excellent and informative explanation of what is being shown in the Memory tab of Activity Monitor. Thanks Gary.

    Mark
    3 years ago

    why do many of my safari tabs take up so much RAM?I have one tab taking up 7GB, another 1.99, another 1.58GB, another 1.29GB, another 1.14GB, etc. Running M1 iMac with 16GB of RAM?

    3 years ago

    Mark: First, see this video. I explain how macOS doesn't want memory to go unused. So the page may not need 7 GB, but if it has plenty of RAM it will use it. Also, distinguish between real RAM and swap memory. Also, consider what is going on on the page itself. A web page can be just some text, or it can be a complex collection of text, graphics, styles, media, scripts and more.

    Steve
    3 years ago

    AWESOME VIDEO GARY!!!!! Incredibly informative - Thanks!

    Alan Driver
    3 years ago

    That was really informative and explained the topic in nice plain simple English, Many thanks for covering this topic

    JasonB
    3 years ago

    Hi Gary. Great video! Question - how do computers compress files/memory, etc. I mean, how do you squish the 1's and 0's to make them still readable by the OS? I've never quite understood it. Thanks!!

    Milner Erlank
    3 years ago

    Most informative. My rehab Late 2013 iMac/ Catalina has a major SPOD problem and I was hoping your tutorial would help to discover the cause. While listening to you I checked the Activity Monitor/Memory. Noticed the memory pressure panel was solid yellow – for ever. There was a power outage and on re-boot with only Safari and Photos running the panel is a nice green. Strange: the user column shows mainly admin and root with Safariusing 81.7MB. It would appear the SPOD issue is something else.

    3 years ago

    JasonB: Not sure what algorithms they use exactly, sorry. But imagine if you are editing an image with a black background. That would be a lot of black pixels (#000000) in a row. So instead of 4,000 bytes all containing zeros, it can just remember "run of 4,000 zeros." That's just one example of a compression algorithm.

    Kathy
    3 years ago

    Hi Gary, great video thank you! I know you're talking about M1 Macs, but if you don't mind I have a question about memory on my iPhone 10s (64GB with 36.93GB Available) with 3G of RAM. Does the phone 'run out' of memory unless it's restarted frequently I wonder? It seems one banking app's notifications occasionally don't come through unless I restart the phone. Then I have the notification visible. Just curious why this would be happening. Thanks so much. K

    3 years ago

    Kathy: I doubt the cause of a notification issue with one app is being out of memory. If that happened, somehow, you would have much more going on than just that. It is probably an issue with that app.

Comments are closed for this post.