Skip to content

Swap files and the sleep image on Mac: why they take space

Swap files on a Mac: how macOS uses disk space as extra memory, what the sleep image is for, how to check both, and why a restart beats deleting them.

System Data and macOS · Published · 21 min read
A modern laptop with a glowing keyboard illuminated in a dark, minimalist setting.
Photo: Abdelrahman Ahmed on Pexels

Swap files on a Mac are disk space macOS borrows as extra memory. When apps need more memory than your Mac has, macOS first compresses what's idle, then writes some of it to swap files on the startup disk. Activity Monitor shows that space as Swap Used, and Storage settings counts it in System Data.

The sleep image is a different file with a related job. On a laptop, macOS saves a copy of memory to it, so your open work survives if the battery runs out while the Mac sleeps.

Both belong to macOS. It creates them, grows them and removes them, and it doesn't let you delete them while it's using them. The supported way to shrink swap is to restart, and the way to keep it small is to use less memory at once. The sleep image is best left alone.

On a typical Mac, the two together take somewhere between 1 and 20 GB. This post explains where they live, what makes them grow, how to read Activity Monitor's figures, and what not to do.

How swap files work on a Mac

Memory and storage are different things. Memory, also called RAM, holds what your apps are working on right now; it's fast and limited. Storage holds your files, even when the Mac is off. Swap is where the two meet: storage standing in for memory when memory runs short.

What happens when your Mac runs out of memory?

macOS doesn't wait for memory to fill up. As it gets close, it works through roughly these steps:

  1. It uses free memory for apps and keeps recently used files in memory too, so they open faster.
  2. It drops cached files it can read again from disk.
  3. It compresses memory that apps aren't using right now. Apple describes this as compressing inactive apps as your Mac nears its memory limit.
  4. It writes memory out to swap files on the startup disk, and reads it back when an app needs it again.

Each step keeps your apps running. The last one is the only one that uses disk space, and the only one you'll notice in Storage settings.

Where are swap files stored?

On current versions of macOS, swap files live on their own APFS volume, named VM, which macOS mounts at /System/Volumes/VM. Inside are files named swapfile0, swapfile1 and so on. macOS adds files as it needs more room.

The sleep image is a single file named sleepimage, in /private/var/vm. Neither location appears in Finder's sidebar, and nothing in either folder is yours to manage.

WhatWhereWhat it holdsWho manages it
Swap files/System/Volumes/VMMemory moved out of RAMmacOS
The VM volumeYour startup disk's containerThe swap filesmacOS
Sleep image/private/var/vm/sleepimageA copy of memory saved during sleepmacOS
Compressed memoryIn RAM, not on diskIdle memory squeezed smallermacOS

Why is swap on a separate volume?

Your startup disk is an APFS container holding several volumes: the system, your data, and smaller ones for startup, Recovery and virtual memory. They all share the container's free space, so the VM volume takes only what the swap files use at the moment.

The Eclectic Light Company, which writes about macOS internals, notes that the VM volume should be tiny, under 1 MB, when no swap is in use. It grows as macOS writes swap files and shrinks again after a restart.

Are swap files encrypted?

Yes. Apple calls this secure virtual memory: macOS encrypts the data it writes to swap, so what was in memory isn't left on the disk where someone scanning it could read it. Apple's macOS 27 guide says it's always on, and there's no setting for it.

That also means the files are useless outside the running system. There's nothing in them for you to open, recover or inspect.

How big is each swap file?

Apple doesn't document it. The files appear one at a time as macOS needs room, so the number of files, not the size of each, is what tracks how much swap is in use. A Mac that has just started may have one swap file or none.

The sleep image and hibernation

What is the sleep image for?

When a Mac sleeps normally, its memory stays powered and holds everything you had open. If power to the memory is lost, for example because a laptop's battery runs flat, that copy is gone.

The sleep image is the insurance. macOS writes a copy of memory to the disk before or during sleep, and if power runs out, the Mac restores your session from that copy instead of starting fresh. The manual page for pmset, macOS's power management tool, calls this a hibernation image.

Which Macs write a sleep image?

It depends on the hibernation mode, a setting that differs between laptops and desktops. The pmset manual describes three modes:

ModeDefault onWhat happens to memory during sleep
0DesktopsKept in memory only; lost on power loss
3LaptopsKept in memory and copied to disk; restored from disk only after power loss
25Never by defaultCopied to disk, then memory is powered off; always restored from disk

Two related features can write the image on desktops too. Standby hibernates a Mac after it has slept for a while, and the manual says it's on by default on supported hardware. Auto power off does something similar after a delay, and wakes from it take longer than from normal sleep.

How large is the sleep image?

Apple doesn't document its size. Because it holds a copy of memory, it can take several gigabytes, and its size varies between Macs and over time.

It isn't necessarily as large as memory, though. On the 24 GB MacBook Pro with Apple silicon that this post was researched on, running macOS 27, the sleep image was 2.1 GB.

Swap and the sleep image are usually counted together, because they share a purpose and a corner of the disk. The research behind the app's catalog puts the two together at 1 to 20 GB on a typical Mac.

Can you turn off the sleep image?

Not in System Settings. Apple's guide to sleep and wake settings in macOS 27 covers Lock Screen, Battery on a laptop and Energy on a desktop: when the display turns off, keeping the Mac awake, putting hard disks to sleep and waking for network access. None of it mentions hibernation or the sleep image.

The only control is in pmset, whose manual marks the hibernation setting "Please use caution". Changing it trades safety for space: a laptop without a sleep image loses everything you had open if its battery runs out during sleep. For a few gigabytes, that's rarely a good trade.

A stylish laptop partially closed, illuminated by a pink light, highlighting its modern design.
On a laptop, the sleep image keeps your open work safe if the battery runs out during sleep. Photo: Filippo Bergamaschi on Pexels

How to see how much swap your Mac uses

How do you check swap in Activity Monitor?

  1. Open Activity Monitor, in the Utilities folder inside Applications. You can also find it with Spotlight.
  2. Click Memory at the top of the window.
  3. Look at the bottom of the window. Swap Used is the space on your startup disk holding swap right now.

The graph labelled Memory Pressure sits beside the figures. It's the most useful single thing on the page, because it says whether your Mac is coping, not just how full memory is.

What do the figures in the Memory tab mean?

Apple's Activity Monitor guide defines each figure. Only one of them is disk space.

FigureWhat Apple says it isDisk space?
Physical MemoryThe amount of RAM installedNo
Memory UsedRAM in use, split into the three belowNo
App MemoryMemory used by appsNo
Wired MemoryMemory the system needs that must stay in RAMNo
CompressedMemory compressed to make more RAM availableNo
Cached FilesFiles cached in unused memory to improve performanceNo
Swap UsedSpace on your startup disk used to swap files to and from RAMYes

Cached Files often looks large and worries people. It's memory macOS is using for speed while nothing else needs it, and it gives it back as soon as an app asks. It isn't on the disk, and it isn't a problem.

What do the memory pressure colors mean?

Apple's guide to checking whether a Mac needs more RAM gives each color a meaning:

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

Apple says memory pressure is worked out from free memory, the swap rate, wired memory and file cached memory. A swap figure with green pressure usually means macOS moved some idle memory out at a busy moment and is coping now. A rising figure with yellow or red pressure means it's swapping steadily.

How much swap is normal?

There's no single normal figure. A Mac that has been running for days, with a browser, a few apps and the odd large job, often shows a few gigabytes of swap with green memory pressure, and that's fine.

What matters is the pattern. Swap that keeps climbing while pressure stays yellow or red means the Mac is short of memory for the work you give it.

What does a lot of swap look like?

Here's one real case. The MacBook Pro this post was researched on had gone six days without a restart, through Xcode builds, simulators and local AI tools. About 21 GB of swap was in use, above the typical range in the chart below.

The VM volume held 22 swap files of about 1 GB each. The oldest dated from a few minutes after the last restart, and the newest from that afternoon. Memory wasn't under strain at the moment we looked, but the swap written during busier hours was still there.

That's the normal behaviour, not a fault. Swap stays until a restart, so a big figure on a Mac that has been up for days says more about its busiest hour than about now.

Swap and the sleep image next to System Data's other parts
  • Swap and sleep image1–20 GB · Managed by macOS
  • App caches2–30 GB · Safe
  • Logs and crash reports0.1–5 GB · Safe
  • Per-user temporary files1–70 GB · Managed by macOS

Typical ranges from the research behind the app's catalog, on Macs that have these items at all. Swap depends on how much memory your work needs at once, and resets when you restart.

Where does swap show up in Storage settings?

In System Settings › General › Storage, swap is part of System Data, the category for files that don't fit anywhere else. It has no line of its own there, and no information button.

Disk Utility shows it more directly. Choose View › Show All Devices, so the sidebar lists each disk with its containers and volumes, then select your startup disk's container. The Eclectic Light Company points to this view for the VM volume's size. For what else hides in System Data, see the System Data guide.

Why does System Data shrink after a restart?

Restarting clears the swap files. If System Data was several gigabytes smaller the morning after a restart, swap was probably part of the difference; Time Machine's local snapshots aging out are the other usual reason.

The space comes back as soon as you work the same way again, which is expected. It's a one-off gain, not a fix.

Why swap grows

Swap grows for one reason: the work on your Mac asks for more memory than it has. What varies is the work, and Activity Monitor can tell you which app is asking.

Which apps use the most memory?

In Activity Monitor's Memory tab, click the Memory column heading to sort processes by how much they use. The top of the list is usually one of these:

  • Web browsers, which run tabs and extensions as separate processes, so many open tabs add up.
  • Virtual machines and containers, which are given a share of memory for a whole other operating system.
  • Local AI models, which keep the model in memory while it runs, so a large model takes many gigabytes.
  • Video, photo and audio editors working on large projects.
  • Developer tools during large builds, test runs and simulators.

None of these is wrong to use. They just add up, and the total is what decides whether macOS swaps.

Which Macs swap the most?

Macs with the least memory for the work they do. Until late 2024, many Macs, the MacBook Air among them, started at 8 GB of memory; Apple then made 16 GB the starting point. An 8 GB Mac running today's browsers, chat apps and creative tools swaps sooner and more often.

More memory doesn't make swap disappear. A Mac with plenty of memory still swaps if one job asks for more than it has, such as a large AI model or several virtual machines at once.

How do virtual machines and Docker add to swap?

A virtual machine runs a whole operating system, and that system needs memory of its own. Most virtualization apps set its share in the app's own settings, and the Mac has to find that memory whether the guest is busy or not.

Docker Desktop is a common example on developers' Macs. Its documentation says the Memory limit under Settings › Resources › Advanced defaults to half of your Mac's memory.

Lowering that limit, or quitting Docker Desktop when you're not using it, leaves more for everything else. Its disk image is a separate matter, covered in the post on Docker Desktop's disk space.

Can one app make swap grow by itself?

Yes. An app with a bug can keep asking for memory and never give it back, which is called a memory leak. Its figure in Activity Monitor climbs steadily, hour after hour, even while you're not using it.

Quitting the app gives the memory back, and updating it often fixes the cause. If you can't quit it normally, select it in Activity Monitor, click the Stop button at the top of the window, and choose Quit. Choose Force Quit only if that fails: it ends the app at once, and any unsaved work in it is lost.

What happens when the disk is nearly full too?

Swap needs free space on the startup disk. On a disk that's nearly full, macOS has little room to write it, and a Mac that's short of memory has nowhere to put the overflow.

People who reach that point often see a message that their system has run out of application memory, which asks them to quit apps they aren't using.

Apple doesn't publish how much free space macOS needs for swap, so keeping a healthy margin free is the practical answer. The post on a full startup disk covers what to clear.

What you seeLikely causeWhat to do
A few GB of swap, green pressureNormal use over daysNothing
Swap climbing, yellow pressureToo much open at onceQuit apps or browser tabs you're not using
One app's memory climbing for hoursA memory leakQuit and update that app
Red pressure most of the timeNot enough memory for your workUse less at once, or plan for more memory
A message about running out of memoryLittle memory and little free diskQuit apps, free disk space, restart

How to make swap smaller, safely

Restart your Mac

Restarting clears the swap files, and it's the supported way to get their space back. Save your work and quit your apps first, then choose Apple menu › Restart.

When the Mac starts again, it begins with almost no swap. How fast it grows back depends on what you open, so restart before a job that needs disk space, such as a macOS update.

Quit what you're not using

Quitting apps, closing browser tabs and shutting down virtual machines you've finished with gives their memory back at once. If memory pressure drops to green, macOS has much less reason to add to swap.

Swap that was already written may stay until you restart, but it grows more slowly, or not at all.

Open fewer apps at login

Apps that open at login use memory from the moment your Mac starts, whether you use them or not. Choose Apple menu › System Settings, click General, then Login Items & Extensions. Under Open at Login, select an app you don't need there and click the Remove button.

The same pane has App Background Activity, for apps allowed to do work while they aren't open. Turn off any that belong to apps you've removed or no longer use. The pane is the same in macOS 26; in macOS 14 and earlier it was called Login Items.

Do Storage settings' recommendations help?

Not with swap. Store in iCloud, Optimize Storage and Empty Trash automatically act on your files, not on memory. They can still help indirectly: more free space on the startup disk gives macOS room to write swap when it needs to.

Should you add more memory?

If memory pressure is red most of the time, Apple's answer is that your computer needs more RAM. Whether you can add it depends on your Mac.

To check, hold the Option key, choose Apple menu › System Information, and click Memory under Hardware. If the Memory Slots pane appears, its Upgradeable Memory entry says whether you can replace or install memory. If it doesn't appear, Apple says upgradeable memory isn't available for your Mac, which is the case on Macs with Apple silicon.

On those Macs, memory is fixed at purchase. The practical choices are to run less at once, or to choose more memory when you next buy a Mac.

Detailed view of RAM sticks and microprocessors on a motherboard.
Swap is disk standing in for memory: more memory, or less open at once, is what keeps it small. Photo: Sergei Starostin on Pexels

Why you shouldn't delete swap files or the sleep image

What happens if you delete swap files?

macOS uses them as part of memory. The catalog entry for Swap files and sleep image warns that removing them while macOS uses them can make your Mac stop responding or restart unexpectedly.

macOS usually won't let you try. In one Apple Community thread, a user whose maintenance utility suggested deleting swapfile0 got "Operation not permitted", and the replies explained why the attempt was a bad idea.

Even if it worked, the space would come straight back: macOS writes swap again as soon as memory runs short. A restart gets you the same space without the risk.

What about the sleep image?

The sleep image is less dangerous to lose than swap, but there's still no point removing it. macOS writes it again the next time the Mac sleeps with hibernation on, so the space comes back almost at once.

The only way to keep that space is to turn off hibernation with pmset, and that removes the protection the file exists for.

What if an app offers to remove them?

Decline. Swap files and the sleep image are managed by macOS, and an app that lists them as removable is treating them like caches. Restart instead, and look at whatever else that app suggests with the same caution.

Can you move swap or the sleep image to another drive?

No. Howard Oakley of The Eclectic Light Company has pointed out that swap can't be put on an external drive, and that it would be slower there anyway, since the internal SSD is faster. The pmset manual says the hibernation image may only be located on the root volume.

Both have to stay on the startup disk. What you can move to another drive is your own files, which leaves more room on the startup disk for swap when it's needed.

Do memory cleaner apps help?

Some apps promise to free memory with a button. If what they free is cached files, macOS was already managing that memory and would have given it back on demand.

Apple describes cached files as files kept in unused memory to improve performance. Clearing them means macOS reads those files from disk again. It doesn't reduce swap already written, and it doesn't add memory your Mac doesn't have.

Common adviceWhat really happens
Delete the swap files to free spacemacOS blocks it, and swap comes back as soon as memory runs short
Delete the sleep imagemacOS writes it again the next time the Mac sleeps
Turn off swapmacOS has no setting for it
Move swap to an external driveNot possible; it stays on the startup disk
Use a memory cleanerFrees cache macOS would free anyway; doesn't add memory
RestartClears swap safely; it grows back with use

Swap, SSD wear and speed

Does swap wear out your Mac's SSD?

An SSD can write only a limited amount over its life, and Apple doesn't publish that limit for its Macs. Writing swap adds to the total, like every other write.

For most people, it's not a concern. The Eclectic Light Company's 2026 look at SSD life calls heavy swap the biggest threat for Macs that don't work with huge media files. Its advice is to have enough memory that swap is rarely used, and to keep a good margin of the disk free, which helps the SSD spread its writes.

So the worry isn't a few gigabytes of swap now and then. It's a Mac that swaps heavily all day, every day, for years.

How can you tell how much of your SSD's writing is swap?

Not precisely, without command-line tools. Activity Monitor's Disk tab shows how often your Mac reads and writes and how much data moves, but its Swap Used figure is what's in swap now, not everything written to it over time.

The Eclectic Light Company's rule of thumb compares the two totals. If swap is under 10% of what the Mac writes, it adds little wear; at 50% or more, more memory would cut the wear a lot. For most people, the memory pressure graph is the simpler guide: if it's green most of the time, swap isn't a large share.

Does clearing swap make a Mac faster?

Clearing swap frees disk space. It doesn't add memory, and it doesn't make a Mac faster by itself.

What does slow a Mac is heavy swapping while you work. Reading memory back from disk is far slower than reading it from RAM, so apps pause while they wait.

The cure is less in memory at once, not less on disk. A restart can feel quicker because it closes everything, and the feeling lasts until you open it all again.

Does a full disk make swapping worse?

It can. With little free space, macOS has little room to write swap. Keeping a margin free matters more on a Mac with little memory, because that Mac swaps more.

There's no published figure for how much is enough. The Eclectic Light Company suggests keeping at least 10% of an SSD free for its own health, with 15 to 25% better; that's a reasonable target for swap too.

Two worked examples

A MacBook Air that's short on both

Say a MacBook Air has 8 GB of memory and a 256 GB disk. Its owner works with a browser full of tabs, a chat app, a music app, and a virtual machine for one piece of work software. Storage settings shows System Data larger than expected, and an update won't install for lack of space.

Activity Monitor tells the story. Memory pressure is yellow, swap used is several gigabytes, and the virtual machine and the browser sit at the top of the Memory column.

What they do, in order

  1. Shut down the virtual machine in its own app, and close browser tabs they don't need.
  2. Watch memory pressure drop toward green in Activity Monitor.
  3. Save their work, quit everything and restart.
  4. Open System Settings › General › Storage and let it finish counting. System Data is smaller by about the swap they had.
  5. Install the update before opening the virtual machine again.

Afterwards, they move two apps out of Open at Login and keep the virtual machine closed unless they need it. Swap still appears on busy days, but it no longer climbs all day.

What they don't do

They don't look for the swap files in Finder, delete the sleep image, or paste a command to turn off hibernation. Each of those trades safety for space that comes straight back.

A developer's Mac with plenty of memory

Now say a MacBook Pro has 36 GB of memory and a 1 TB disk. Its owner runs Docker Desktop at its default memory limit, a local AI model for coding help, and Xcode with two simulators. Swap passes 15 GB by the end of most weeks, and memory pressure turns yellow during builds.

Disk space isn't the problem here; the disk has room. The fix is to see which job asks for the memory, in Activity Monitor's Memory column.

Docker Desktop's limit can come down to what the containers really use, the AI model can be a smaller one, and simulators that aren't in use can be shut down. Swap then grows more slowly, and memory pressure stays green more of the time.

What the two examples have in common

In both, the answer was in Activity Monitor, not in Finder. Neither owner touched the swap files themselves: they changed what was open, and macOS did the rest.

How the app does it

Wombit shows swap and the sleep image like everything else on the disk. Its System Data page splits that one number into named buckets, and swap and sleep image is one of them, next to snapshots, caches, logs and the rest, with how much it couldn't explain shown separately.

It says what they are and what to do, from the catalog entry and its sources. They're Managed by macOS: explained, with macOS's own way of handling them, and never moved or offered for removal. They don't count toward the safe total.

  • /private/var/vm

    Swap files and sleep image

    Disk space macOS uses as extra memory when RAM runs low, and a copy of memory it can save before a long sleep.

    Managed by macOS · Explained only: never removed

Seeing System Data explained is free. Cleanup for the parts of System Data you can remove, such as caches and logs, is PRO, one $4.99 payment with lifetime access.

Frequently asked questions

Is it safe to delete swap files on a Mac?

No. macOS uses them as part of memory, and removing them while it does can make your Mac stop responding or restart unexpectedly. macOS usually blocks the attempt anyway. Restart instead: it clears the swap files safely.

How do I clear swap memory on my Mac?

Save your work and restart your Mac. Swap starts again from almost nothing, and the space comes back to your startup disk. To keep it from growing as fast, quit apps, browser tabs and virtual machines you're not using.

Why is my Mac using so much swap when memory pressure is green?

Swap written during a busy moment stays until you restart, even after the pressure has passed. A few gigabytes of swap with green memory pressure is normal. Look again if swap keeps climbing while the graph turns yellow or red.

What is the sleepimage file in /private/var/vm?

It's a copy of your Mac's memory that macOS saves during sleep, so your open work can be restored if power runs out. Laptops write it by default, and some desktops write it after a long sleep. macOS manages it, and it comes back if removed.

Why are there so many swapfiles in /System/Volumes/VM?

macOS adds swap files one at a time as it needs more room, so many files mean a lot of memory was moved to disk at some point since the last restart. They stay until you restart, even after the busy moment has passed. Restarting clears them, and quitting memory-hungry apps keeps new ones from piling up.

Is swap bad for a Mac's SSD?

Every write adds a little wear, and heavy swap all day for years adds the most. For most people that isn't a concern. If memory pressure is often red, using less memory at once, or more memory in your next Mac, reduces both swap and wear.

Can I turn off swap on a Mac?

No. macOS has no setting for it, and virtual memory is part of how it keeps apps running when memory runs short. What you can control is how much memory your work needs at once.

Does swap count as System Data on a Mac?

Yes. Storage settings counts swap files in System Data, without a line of their own. That's one reason System Data often shrinks after a restart and grows again as you work.

Sources

  1. View memory usage in Activity Monitor on Mac · Apple
  2. Check if your Mac needs more RAM in Activity Monitor · Apple
  3. What is secure virtual memory on Mac? · Apple
  4. pmset(1) manual page · Apple, via xcode-man-pages
  5. Tracking swap space: is it wearing out your SSD? · The Eclectic Light Company
  6. How long will my Mac's SSD last? · The Eclectic Light Company