Check whether you need to clear RAM at all
Open Activity Monitor (press Command-Space, type "Activity Monitor", press Return) and click Memory. Ignore Memory Used for now; look at the Memory Pressure graph at the bottom. Apple's reading of its colors (Apple, Check if your Mac needs more RAM):
- Green: "Your computer is using all of its RAM efficiently."
- Yellow: "Your computer might eventually need more RAM."
- Red: "Your computer needs more RAM."
Green with Memory Used close to the total is the normal state of a Mac. Apple says Cached Files are files "cached by the system into unused memory to improve performance" (Apple, View memory usage), and macOS hands that memory back as soon as an app needs it. Apple's page on memory pressure also says: "When you have free or unused memory, your computer performance does not necessarily improve." Free memory isn't a goal in itself.
Clear memory when the graph is yellow or red and the Mac feels slow, or when macOS tells you it has run out of application memory. How to check RAM usage on a Mac covers the other numbers and the Terminal commands.
How to free up memory on a Mac, in order
Each step is safe; stop when the pressure graph goes back to green.
- Quit the app using the most memory that you can spare. In the Memory tab, click the Memory column heading to sort by it. Save your work in that app, then quit it with Command-Q. Apple's first advice for a slow Mac is the same: "Quit any apps you're not using" (Apple, If your Mac runs slowly).
- Close browser tabs and windows. Each tab can hold a lot of memory, and they don't show under the browser's own name: Chrome's tabs run as Google Chrome Helper (Renderer) and Safari's pages run in WebKit processes. Bookmark what you want to keep and close the rest.
- Quit apps you aren't using. Closing an app's last window often leaves the app running. Look along the Dock and at Command-Tab for apps you forgot about.
- Quit menu bar apps and helpers you don't need. They're small one by one but add up. If they come back at every login, see how to stop apps opening on startup.
- Close virtual machines and heavy projects when you're not using them. A virtual machine reserves memory for the system inside it; on our Mac, one was using about 1.9 GB in the background.
- Restart. It starts memory and swap from empty and is the quickest way to clear everything when you can't tell what's responsible.
If one app's memory keeps rising the longer it runs, even when you aren't doing more with it, that's usually a bug in the app. Update it, and quit and reopen it now and then until the developer fixes it.
Memory pressure, compression and swap in plain words
When apps need more memory than is free, macOS has three ways to make room, used roughly in this order:
- It drops cached files it can read from disk again later.
- It compresses memory that hasn't been used recently. Apple's figure for this is Compressed: "the amount of memory that has been compressed to make more RAM available".
- It swaps compressed memory out to the startup disk. Swap Used is "the amount of space being used on your startup disk to swap unused files to and from RAM" (Apple).
Pressure rises as the Mac moves down that list. Swap is far slower than memory, so a Mac that's swapping heavily feels sluggish everywhere. This read-only command shows how much swap is in use:
sysctl vm.swapusage
On our MacBook Pro (M2 Max, 32 GB, macOS 27.0.1) it printed vm.swapusage: total = 18432.00M used = 17533.19M free = 898.81M (encrypted). The swap itself lives in 1 GB files in /System/Volumes/VM; while we wrote this, macOS added two more, taking the total from 16 to 18 GB. That's a Mac doing far more than its memory comfortably holds. Some swap is normal; a large figure that keeps growing while the pressure graph is yellow or red is the sign to act.
Swap needs free disk space. Apple's developer documentation says macOS doesn't use a fixed partition for it and instead "uses all of the available space on the machine's boot partition" (Apple Developer, About the Virtual Memory System). On a nearly full disk, memory runs out sooner; that's when you see "Your system has run out of application memory", and freeing up space helps memory too.
What about the purge command?
Older tips suggest running purge in Terminal. Its manual page describes it as forcing the "disk cache to be purged (flushed and emptied)", meant to "approximate initial boot conditions with a cold disk buffer cache for performance analysis". It also says it "does not affect anonymous memory that has been allocated through malloc", which is the memory apps use for their own work. On current macOS it needs an administrator password (sudo).
So purge throws away the cached files macOS keeps to make things faster, and leaves alone the app memory that's actually causing pressure. Memory Used drops, then refills as apps read those files from disk again. We don't recommend it.
Why "RAM cleaner" apps don't help
An app can't free memory that another app is using without quitting that app. What memory cleaners can do is make macOS drop its cached files, the way purge does, or briefly claim a large amount of memory themselves so macOS evicts cache and compresses other apps to make room. Either way, the number looks better and the Mac has to read things from disk again. Apple's own guidance, quoted above, is that free memory doesn't necessarily improve performance. If pressure is green, there's nothing to clean; if it's red, the fix is to quit something, which you can do yourself in Activity Monitor.
The same applies to clearing caches to "speed up" a Mac; how to clear cache on a Mac explains when that's worth doing. Memory cleaners often come inside clean-up suites; Is MacKeeper safe? looks at one of them, tool by tool.
When the real fix is more memory
If pressure is yellow or red every day with the apps you normally use, the Mac needs more memory than it has. On Macs with Apple silicon that can't be added later: Apple says memory "is integrated into the Apple M-series chip package" in Mac mini and iMac models with Apple silicon "and can't be upgraded" (Apple, Mac mini memory; iMac memory), and that Apple laptops not listed in its memory-upgrade table "have non-removable memory" (Apple, MacBook Pro memory). The options are to run fewer heavy apps at once, and to choose more memory with your next Mac. How much RAM you need covers how to judge that from your own Mac.
How Tend helps
Tend's free Memory page, in Advanced view, shows memory pressure in plain words, the same breakdown as Activity Monitor (app memory, wired, compressed, cached files and free), swap used, and the apps using the most memory. Energy & Apps, also free, has Quit and Force Quit on every app. Tend doesn't "clean" memory, for the reasons above. Pro's option to slow a heavy app down by running it at low priority helps with CPU, not memory.
Questions
How do I clear my RAM on a Mac?
Check Memory Pressure in Activity Monitor's Memory tab first. If it's yellow or red, sort by the Memory column and quit the biggest app you can spare, close browser tabs, quit apps you aren't using, or restart the Mac. If it's green, there's nothing to clear.
Is it bad that my Mac's memory is almost full?
No. macOS keeps recently used files in spare memory to make things faster, so Memory Used is often near the total. What matters is the Memory Pressure graph: green is fine, yellow and red mean memory is short.
Does restarting a Mac clear RAM?
Yes. A restart starts memory and swap from empty, which is why it helps when the Mac has been swapping heavily. Quitting the app that's using the most memory often works just as well without a restart.
Do RAM cleaner apps work on Mac?
They make the free memory figure look better, mostly by making macOS drop cached files, which it then has to read from disk again. They can't free memory an app is using without quitting it. Apple says free memory doesn't necessarily improve performance.
What is swap on a Mac?
Swap is space on the startup disk where macOS moves compressed memory it isn't using right now. Some swap is normal; a large, growing amount while memory pressure is yellow or red means the Mac is short of memory. Swap needs free disk space.
Related guides
“Your system has run out of application memory” on Mac
When macOS runs out of memory
How to check RAM usage on a Mac, and how much you need
Read the numbers, and how much you need
Activity Monitor on Mac: how to open it and read each tab
Every tab explained
Why is my Mac so slow? How to find the cause and fix it
When memory isn't the cause
More detailed guides:
Sources
- Apple, Check if your Mac needs more RAM in Activity Monitor
- Apple, View memory usage in Activity Monitor on Mac
- Apple, If your Mac runs slowly
- Apple Developer, About the Virtual Memory System (documentation archive)
- Apple, Upgrade or install memory in your Mac mini, Install memory in an iMac and MacBook Pro: How to remove or install memory
- Apple,
man purgeon macOS 27.0.1;sysctl vm.swapusagerun on a MacBook Pro with M2 Max and 32 GB, macOS 27.0.1
See which app is using your memory
Tend is free to download. Pro is $1.99 a month, $12.99 a year with a 7-day free trial, or $29.99 once.