> What is the sleepimage on a Mac? Learn why /private/var/vm, sleepimage and swap files exist, how to check their size safely, and why not to delete them.

[← All guides](https://maczentra.com/blog)System Data

# Sleepimage on Mac: What It Is and Is It Safe?

The MacZentra team · Updated Dec 1, 2026 · 6 min read

The `sleepimage` on a Mac is a file in `/private/var/vm` where macOS can save the contents of your memory so the Mac can restore your session after a deep sleep or a power loss. It sits next to the swap files, which hold memory that spilled onto the disk. Both are managed by macOS, so you should not delete them or switch hibernation off to win space back. MacZentra breaks System Data into real folders and lists APFS snapshots, so the grey bar finally has names. Working that out by hand takes Terminal commands most people never learn. See [System Data and APFS Snapshots](https://maczentra.com/features#maintain) or [try MacZentra free](https://maczentra.com/).

## What is /private/var/vm?

The `vm` folder holds the files behind virtual memory. On a Mac, `/var` is a link to `/private/var`, so `/var/vm` and `/private/var/vm` are the same place. You will usually find two kinds of files in it.

File | What it is | Who manages it |
`sleepimage` | A saved copy of memory, used to restore your session after deep sleep or when the battery runs out | macOS |
`swapfile0` | Swap: memory pages pushed to the disk when RAM is under pressure. More files (swapfile1, swapfile2) can appear | macOS |

Which files exist, and how big they are, depends on your Mac and your macOS version. Some Macs show a large sleepimage, others show a small one or none at all. Swap files grow and shrink as you use the machine, and they are usually the ones that change from day to day.

## Why does the sleepimage exist?

Sleep keeps your session alive by leaving a little power going to memory. If that power runs out, say the battery dies overnight, whatever was only in memory would be lost. The sleepimage is the safety net: macOS writes a copy of memory to disk so it can bring your windows back on the next start. The size is tied to how much memory the Mac has, so a Mac with a lot of RAM can have a large file here.

Swap is a different job. When apps want more memory than the Mac has free, macOS moves less-used pages to disk to make room. That is normal behaviour, not a fault. If you see a lot of swap, the answer is usually to close heavy apps, not to hunt for the file. We explain the memory side in [memory vs storage on Mac](https://maczentra.com/blog/memory-vs-storage-on-mac).

## How to check the size (read-only)

These commands only look. They change nothing:

Terminal

```
ls -lh /private/var/vmdu -sh /private/var/vm 2>/dev/null
```

The first lists each file with its size. The second gives the total for the folder. If a command prints “Operation not permitted” or shows nothing, that is macOS protecting the folder, and it is fine to stop there. You can also see which sleep mode your Mac uses with a read-only query:

Terminal

```
pmset -g | grep hibernatemode
```

The number you get back is the current mode. Do not change it. Apple’s defaults are chosen for each Mac model, and a wrong value can cost you unsaved work after a dead battery.

## Why this space comes and goes

If your free space looks lower than it should, the files in `vm` are one small part of a bigger picture. Storage also holds local Time Machine snapshots, caches, logs and other things that macOS reports as System Data. The grey bar in Settings does not tell you which is which. Start with [what System Data is](https://maczentra.com/blog/system-data-on-mac), then see why free space can shift after a restart in [what purgeable space on Mac means](https://maczentra.com/blog/purgeable-space-on-mac).

A restart is also the safe way to shrink swap: when the Mac reboots, swap files are cleared, and macOS builds new ones as needed. Quitting an app that was using a lot of memory has a similar effect over time.

![MacZentra System Data view showing which parts of the startup disk are system-managed and which can be reviewed](https://maczentra.com/guides/systemdata.webp)System Data breaks the grey bar into named parts, so you can see what is yours to review and what is macOS territory.

## Why you cannot get this space back for good

Even if you could remove the sleepimage, it would come back. macOS writes it again when the Mac goes into the sleep mode that uses it, and it sizes the file to match your memory. The same goes for swap, which is created whenever apps need it. Space you appear to gain by deleting these files is taken back within hours, and you have traded a safety net for nothing.

There is also a practical reason to leave it: the folder sits on the protected system side of the disk. Tools that try to clear it are working against the operating system, and a cleaner that offers to delete it is not a cleaner you should trust. Real, lasting space comes from files that you own and can recreate or replace.

## What you can safely do instead

- **Restart the Mac.** It clears swap and often brings free space back without any file work.
- **Close memory-hungry apps** such as browsers with many tabs, virtual machines and video editors. Less swap, less disk churn.
- **Find the real big items.** Your own files, old downloads and app caches are far larger than a sleepimage. Use [the ways to check storage on a Mac](https://maczentra.com/blog/how-to-check-storage-on-mac) or [find large files](https://maczentra.com/blog/find-large-files-on-mac).
- **Clear user caches** for apps you recognise, as covered in [what is safe in ~/Library/Caches](https://maczentra.com/blog/library-caches-safe-to-delete).
- **Look at the temporary folder** macOS keeps per user: [what is /var/folders](https://maczentra.com/blog/what-is-var-folders-on-mac) shows how to measure it.

If the disk is close to full, the steps in [startup disk full on Mac](https://maczentra.com/blog/startup-disk-full-mac) are ordered by how much each one usually returns. Your Downloads folder is another common culprit, and [cleaning the Downloads folder on a Mac](https://maczentra.com/blog/clean-downloads-folder-mac) is a good first stop. Logs are small but easy to review, as shown in [how to delete log files on a Mac](https://maczentra.com/blog/delete-log-files-on-mac).

## Questions people ask

### Is it safe to delete the sleepimage file on a Mac?

We do not recommend it. The file is managed by macOS, protected by the system, and recreated when it is needed. Deleting it does not give you lasting space and you risk losing your session after a power loss.

### Why is my sleepimage so big?

Its size follows the amount of memory the Mac has, because it is a copy of what is in memory. A Mac with a lot of RAM will have a bigger file. It is not growing over time like a cache does.

### What are swapfile0 and swapfile1 on a Mac?

They are swap files, where macOS parks memory pages when RAM is full. They come and go with your workload and are cleared on restart.

### Can I turn hibernation off on a Mac?

There are `pmset` settings for it, but they are not a good idea for a laptop. Without the saved copy, a dead battery means lost unsaved work. This guide does not recommend changing them.

### Why can’t I see /private/var/vm in Finder?

System folders are hidden by default. You can look at them in Terminal with `ls` as shown above, but there is nothing in there you need to open or edit.

## Everything MacZentra can clean

Treemap and Sunburst disk maps, a duplicate finder, Developer Junk, a complete app uninstaller and more, in one native storage cleaner for Mac that’s 15.4 MB.

[Explore all features →](https://maczentra.com/features)

## Related guides

[![Cover image for Delete iPhone Backups on Mac to Free Space](https://maczentra.com/thumbs/systemdata.webp)Old iphone backups?System Data · 5 minDelete iPhone Backups on Mac to Free SpaceOld iPhone backups can fill tens of gigabytes of your Mac. Find where they live, check their size and delete them safely from Finder, step by step.](https://maczentra.com/blog/delete-iphone-backups-on-mac)[![Cover image for How to Clear System Data on Mac: What Is Safe to Delete](https://maczentra.com/thumbs/systemdata.webp)Clear System Data safelySystem Data · 8 minHow to Clear System Data on Mac: What Is Safe to DeleteReview what contributes to System Data on Mac, identify files you no longer need, and learn what to leave alone before clearing space.](https://maczentra.com/blog/clear-system-data-mac)[![Cover image for How Much Storage Does macOS Take Up? (Why It Looks Bigger)](https://maczentra.com/thumbs/editorial-how-much-storage-does-macos-take-up-2027-guide.webp)Why macOS looks biggerSystem Data · 6 minHow Much Storage Does macOS Take Up? (Why It Looks Bigger)macOS itself is smaller than Storage settings suggest. Measure each volume, see why System Data looks huge, and how much space an update needs.](https://maczentra.com/blog/how-much-storage-does-macos-take-up-2027-guide)[![Cover image for Best Mac Storage Cleaners 2027: Compared & Ranked](https://maczentra.com/thumbs/editorial-best-mac-storage-cleaners.webp)Compare before you cleanCheck storage · 9 minBest Mac Storage Cleaners 2027: Compared & RankedMac storage cleaners and disk space analyzers compared by price, size, scan speed and licence. One-time, subscription and free options side by side.](https://maczentra.com/blog/best-mac-storage-cleaners)

Source: https://maczentra.com/blog/what-is-sleepimage-on-mac
