Mac sleepimage and swap files: why /private/var/vm can hold gigabytes, and what actually shrinks it

By the Zofle team · 10 November 2026 · 5 min read

The macOS VM volume holding a sleepimage and swap files, with the commands that measure them

Your Mac keeps two kinds of memory files on disk: a sleepimage (a copy of RAM for safe sleep) and swap files (memory pages that did not fit in RAM). Both live on a small hidden volume, both are managed by macOS, and both can add up to a surprising number on a 256 GB Mac.

Good news first: you rarely need to delete anything. Swap goes away on its own once memory pressure drops, and the sleepimage is there for a reason.

Where they live

  • The folder you'll see in guides is /private/var/vm.
  • On macOS Catalina and later it points to its own APFS volume, mounted at /System/Volumes/VM.
  • Inside: sleepimage and swapfile0, swapfile1 and so on.
  • Because it's a separate volume in the same container, its space comes out of the same free space as your files, and Storage settings counts it under System Data.

Step 1: look, don't touch

bash
# what's in the VM volume, with sizes
ls -lh /System/Volumes/VM

# total used by that volume
df -h /System/Volumes/VM

# swap right now
sysctl vm.swapusage

# sleep mode and the sleepimage path
pmset -g | grep -E 'hibernatemode|hibernatefile'

Example of what sysctl prints on a busy Mac (yours will differ):

text
vm.swapusage: total = 6144.00M  used = 5321.25M  free = 822.75M  (encrypted)
  • total is what the swap files take on disk now: 6144 MB = 6 GB here.
  • used is how much of that holds memory pages: 5321 MB, about 87% of it.
  • Activity Monitor > Memory shows the same figure as Swap Used, next to the Memory Pressure graph.

The sleepimage: what hibernatemode means

hibernatemodeWhat happens at sleepDefault onsleepimage written?
0RAM stays powered, nothing copied to diskDesktops (iMac, Mac mini, Mac Studio, Mac Pro)No
3Safe sleep: RAM copied to disk and kept powered; if the battery runs out, the Mac restores from diskLaptops (MacBook Air, MacBook Pro)Yes
25Hibernate: RAM copied to disk and power removed; slower sleep and wake, less battery drainNever default, set with pmsetYes

On Intel Macs the sleepimage is usually the size of installed RAM. On Apple silicon it's often smaller, because only what's needed is saved. Check yours with ls -lh /System/Volumes/VM/sleepimage.

How much of your disk that is

Worst case is a laptop in mode 3 with a RAM-sized sleepimage plus a few GB of swap. Here is the share of the disk, with 4 GB of swap added:

RAMsleepimage (RAM-sized)+ 4 GB swapShare of 256 GBShare of 512 GB
8 GB8 GB12 GB4.7%2.3%
16 GB16 GB20 GB7.8%3.9%
32 GB32 GB36 GB14.1%7.0%
64 GB64 GB68 GB26.6%13.3%

Share = (sleepimage + swap) / disk size, so 20 / 256 = 7.8%. On a desktop in mode 0 the sleepimage column is zero and only swap is left.

Shrinking swap: lower the memory pressure

  1. Open Activity Monitor > Memory and sort by Memory.
  2. Quit what you're not using: browser windows with dozens of tabs, VMs, Docker, Simulators, big Photoshop files.
  3. Watch Memory Pressure. Green means RAM is coping; yellow or red means macOS is leaning on swap.
  4. Restart. Swap files are removed at boot and only come back if pressure does.
  5. Run sysctl vm.swapusage again. If total climbs back to many GB every day, the fix is fewer apps open at once (or more RAM next time), not cleanup.

Never delete swapfile entries yourself. They hold live memory of running apps; removing them can crash those apps or the whole system.

The sleepimage: usually leave it

  • On a laptop, mode 3 protects your open work if the battery dies during sleep. That's worth a few GB.
  • On a desktop it's normally already mode 0, so there's nothing to win.
  • Guides that run sudo pmset -a hibernatemode 0 and then delete the file do get the space back on a laptop, but you lose that protection. If you do it anyway, keep the battery topped up and undo it with sudo pmset -a hibernatemode 3.
  • A sleepimage that's far bigger than your RAM, or a VM volume that never shrinks after a restart, is worth asking Apple Support about rather than deleting.

Where the space usually is instead

If System Data is huge and the VM volume is only a few GB, look at local snapshots and purgeable space first: purgeable space and Time Machine snapshots, measured. Developers should also check Xcode and iOS Simulators, and anyone can check the Spotlight index.

Zofle shows where your Mac's space went, category by category, so you can tell whether swap is the problem or just a few GB next to caches and old downloads.

Download Zofle for Mac

Sources and method

  • pmset command reference: hibernatemode 0 (default on desktops), 3 (safe sleep, default on laptops), 25 (hibernate); hibernatefile location.
  • Apple Activity Monitor User Guide, View memory usage (Memory Pressure, Swap Used).
  • Apple Mac User Guide, Free up storage space on your Mac. Sources checked 10 November 2026.
  • The disk-share table is arithmetic for a RAM-sized sleepimage plus 4 GB of swap, decimal GB. The sysctl line is an example of the output format, not a reading from your Mac.

Zofle Pro news

People signing up now will get Zofle Pro, with more features, for free when we launch it.

One email when it's ready. No spam, ever.