Is your Mac using swap? What it means and when to worry

Swap is macOS using part of your startup disk as overflow memory. A Mac that uses some swap is behaving normally. It is a problem only when swap keeps growing while the Mac is slow, which means you are asking for more memory than the Mac has. A few gigabytes of swap on a Mac that feels fine is nothing to act on.

This post explains what swap is, how to check yours, how to tell harmless swap from the kind that hurts, and what to do about it.

What swap is

Your Mac has a fixed amount of memory, and everything running needs some of it. When it fills, macOS first lets go of cached data it can simply read from disk again. After that it has two ways to make room. First it compresses data that has not been used lately, which is quick. If that is not enough, it moves some of that data out to the startup disk, into swap files, and brings it back when an app asks for it.

Disks, even the fast ones in current Macs, are slower than memory. So swap is the safety net: it keeps apps running instead of failing, at the cost of some speed whenever data has to come back from the disk.

Swap also holds things that are simply unlikely to be needed again soon. An app you opened days ago and have not touched since might have parts of its memory sitting in swap. When you go back to it, you may see a brief pause while macOS reads them back.

How to check how much swap you are using

Terminal can show it in one line, and it only reads:

sysctl vm.swapusage

The output gives a total, an amount used and an amount free, and notes that it is encrypted. The total is not a fixed limit. macOS makes the swap space grow as it is needed, as long as the disk has room.

Swap alone does not tell you whether the Mac is struggling, so watch memory pressure alongside it. In Terminal, memory_pressure, typed on its own with no options, prints a summary that includes swap-ins and swap-outs and ends with the share of memory that is free. Foreman has a Performance page with a Memory section that shows memory pressure live, with a minute of history and the apps using the most memory underneath.

When swap is harmless

Swap on its own, with nothing else wrong, is not a fault. These are the usual harmless cases:

  • Some swap used, and the Mac feels quick. Old, idle data has been parked on disk. This is the system doing its job.
  • Swap stays the same size for days. Nothing is pushing memory harder, and swap has settled.
  • A burst of swap after a heavy task. You rendered a video or opened a huge file, memory filled, and swap grew. It may not shrink straight away even after the job is done. macOS tends to leave data where it is until it is needed.

A big number in the used column after a heavy day is not a cause for alarm. Restarting the Mac clears it, and it builds up again only when memory runs short.

When swap points to a problem

Swap becomes a problem when it is part of a pattern:

  1. Swap keeps growing while you work.
  2. Memory pressure is high at the same time. Memory pressure on a Mac: when you actually need more RAM explains how to read it.
  3. The Mac is slow in ways that follow it: pauses when switching apps, stutter, the spinning beach ball.

Constant swapping with high pressure means the Mac is spending its time moving data between memory and disk instead of doing your work. The cause is almost always that too much is open for the memory the Mac has, or that one app has grown far beyond what it needs.

There is a second cost worth knowing about. Swap needs free space on the startup disk. If the disk is nearly full, macOS has less room to swap into, and memory trouble gets worse. In System Settings, General > Storage shows how full the disk is.

What to do about heavy swap

Start with the free fixes.

  • Find the biggest memory user. One app often accounts for most of it. How to see which app is using the most memory on a Mac shows how, and in Foreman it is the Processes page sorted by Memory. Quit it, or reopen it fresh if it has been running for days.
  • Close what you are not using. Browser tabs and windows are the usual weight. Ten tabs you will not read again hold memory just as much as the ones you will.
  • Restart the Mac if it has been on for weeks. A restart clears swap and gives every app a clean start.
  • Free up disk space, so macOS has room to work. System Settings > General > Storage shows what is taking the space.
  • Check what starts at login. Background apps that load every time you sign in hold memory all day. How to stop apps opening at login on a Mac covers it.

If you do all of this, run your usual set of apps, and pressure and swap still climb, your work has outgrown the Mac’s memory. Then more RAM, on the next Mac you buy, is the real answer. How much memory does a Mac really need can help you choose.

Does swap wear out an SSD

This worry comes up often. Swap does write to the startup disk, and flash storage does have a limit on total writes. Swapping now and then is a normal part of how macOS works, and it is not something to avoid at the cost of a slow Mac. Heavy swapping every day is different: it means the Mac is short of memory, and fixing that cuts the writes and makes the Mac faster at the same time.

The short version

Some swap is normal and needs no action. Swap that keeps growing together with high memory pressure and a slow Mac means too much is open. Find the biggest app, quit what you do not need, keep some disk space free, and only then think about more RAM.