Guide

What is memory pressure on a Mac?

Memory pressure is macOS's own measure of how hard it is working to find room for what your apps need. Green is fine. Yellow means macOS is working harder and may need more RAM eventually. Red means it needs more RAM than it has. It is a better health check than the amount of free memory, which is almost always low on a healthy Mac.

What green, yellow and red mean

Apple's support page for Activity Monitor gives the three states in plain terms:

  • Green: the Mac is using all of its RAM efficiently.
  • Yellow: the Mac might eventually need more RAM.
  • Red: the Mac needs more RAM.

Apple's page is Check if your Mac needs more RAM in Activity Monitor. A brief yellow spike when you open a huge project, export a video or start a virtual machine is not a problem. Yellow that stays for hours while you do ordinary work is.

How macOS decides

Apple's Activity Monitor guide says memory pressure is determined by the amount of free memory, the swap rate, wired memory and file cached memory. Apple does not publish the exact formula or the cutoffs for each color, so any specific number you read elsewhere is a guess.

Underneath the graph, the kernel also sends low memory notifications to apps. Many apps respond by dropping their own caches, which is part of why a well written app shrinks when you open something large.

Swap and compression

When memory gets tight, macOS has several moves. It can drop file cache, which is cheap because the files are still on the disk. It can compress data from idle apps so it takes less room. When that is not enough, it writes data to swap files on the startup disk. The order and details vary between macOS versions, but that is the general shape.

So swap is not a failure by itself. A little swap with a green graph is normal. The sign to watch is swap that keeps growing during a work session while pressure sits at yellow or red. Swap Used can also stay above zero for a while after demand drops, so growth matters more than the number.

When to worry

  • The graph is yellow or red for long stretches, not just a spike.
  • Swap Used climbs steadily while you work.
  • Apps stall when you switch between them, or the spinning beach ball shows up often.

If none of that applies, a high Memory Used figure with a green graph is not something to fix. The guide to freeing RAM covers what to do when it does apply.

How to see it

In Activity Monitor, the Memory tab shows the graph at the bottom, along with Memory Used, Cached Files and Swap Used. It only updates while the window is open, so a menu bar app is handier if you want it in view all day. iStat Menus, the open source Stats app and Boost can all show it there.

In Terminal, memory_pressure run with no options only prints statistics. This is trimmed output from a 16 GB Apple silicon Mac:

$ memory_pressure
The system has 17179869184 (1048576 pages with a page size of 16384).

Stats:
Pages free: 27388
Pages purgeable: 930
...
Swap I/O:
Swapins: 20221
Swapouts: 50512
...
System-wide memory free percentage: 37%

The last line is much higher than the Pages free line works out to, so it is clearly counting memory macOS can reclaim and not just pages sitting empty. Do not run memory_pressure with the -l, -p or -S options. Those deliberately create or simulate pressure on the system.

vm_stat prints the raw counters. Give it a number and it repeats every that many seconds:

$ vm_stat 5
Mach Virtual Memory Statistics: (page size of 16384 bytes)

Multiply any page count by the page size on the first line. Apple silicon Macs use 16384 bytes, Intel Macs use 4096. With an interval, the first row shows totals and later rows show the change. Swapins and Swapouts are the lines to watch.

To see the swap total on its own:

$ sysctl vm.swapusage
vm.swapusage: total = 1024.00M  used = 303.25M  free = 720.75M  (encrypted)

The total can grow as macOS creates more swap files. Terminal gives raw numbers with no color, so use it to confirm a trend you have already seen in Activity Monitor.

Boost shows pressure in the menu bar, keeps a reading every minute for a week, and can alert you when swap passes a size you pick. It is free and open source (GPL-3.0), and not notarized by Apple, so the first launch needs an extra step, described on its home page.

Install Boost

Free and open source, installed with Homebrew.

Other ways to install