Is it safe to delete swap files (swapfile0, swapfile1…) on a Mac?
- No. Swap files hold parts of memory macOS moved to the disk to make room. They’re in use for as long as your Mac runs, and macOS creates and removes them itself as memory demand changes.
- What to do instead: close what’s using the memory. Quitting heavy apps brings swap use down, and after a restart the Mac starts with none in use.
- Does it come back? Whenever memory runs short again. A lot of swap is a sign the Mac needs more memory for what you ask of it, not a cleaning problem.
- SiftMac’s verdict: Leave it
1. What it is
When memory runs short, macOS first compresses what it can’t spare. When that isn’t enough, it writes some of memory to the startup disk and reads it back when needed. Those pieces live in swap files named swapfile0, swapfile1 and so on, and they’re encrypted.
On current macOS they sit on a volume of their own, called VM, which Apple’s security guide describes as unencrypted and used by macOS for storing encrypted swap files. Older versions of macOS kept them in /private/var/vm, which is why many guides still point there; today that folder normally holds only the sleep image.
2. Where they are
/System/Volumes/VM
/private/var/vm (older versions of macOS)
The VM volume is hidden in Finder. Terminal lists the files and their sizes without a password:
ls -lh /System/Volumes/VM
3. How big they get
sysctl vm.swapusage shows how much swap exists and how much of it is in use right now. Activity Monitor shows the same in its Memory tab as Swap Used, next to the Memory Pressure graph.
sysctl vm.swapusage
Swap grows a whole file at a time, so the total is usually a little more than what’s used.
4. Why not to delete them, and how to make swap shrink
The files belong to the running system, and removing one would pull memory out from under running apps. macOS offers no way to delete them, and you don’t need one:
- Open Activity Monitor, click Memory, and sort by the Memory column to see which apps use the most.
- Quit what you don’t need: browsers with many tabs, virtual machines, large editors.
- Restart if swap stays high. The Mac starts with fresh memory and nothing in swap.
- If Memory Pressure is often yellow or red, the Mac could use more memory: Apple says yellow means it might eventually need more RAM, and red that it needs more. System Information shows whether yours can be upgraded; on Macs with Apple silicon it can’t, so it’s a choice for your next Mac.
5. What happens afterwards
- Swap Used drops as the apps that needed the memory close.
- After a restart, swap use starts at zero, and new swap files appear only when memory fills up again.
- None of this touches your files: swap only ever holds the contents of memory.
Questions
Can I delete swapfile0?
No. It’s in use by the running system. Quit memory-hungry apps or restart, and macOS manages the files itself.
Why does my Mac use swap when Memory Pressure is green?
macOS moves memory that hasn’t been touched for a while out of the way, so active apps get the RAM. Apple describes green pressure as the Mac using its RAM efficiently, so some swap then is normal.
Where are swap files on a Mac?
On current macOS, in /System/Volumes/VM, a hidden volume of their own. Older versions used /private/var/vm.
Can I turn swap off?
There’s no supported switch for it on a Mac. Run less at once, or choose a Mac with more memory next time.
How SiftMac handles it. SiftMac doesn’t list or touch swap files; they’re part of the running system. Its System Data view sticks to what you can act on, such as purgeable space and snapshots (explained and left to macOS), old macOS installers and device backups.
Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works