If you have ever run a storage audit on your Mac and stumbled across a multi-gigabyte file buried deep in a system folder, there is a good chance you found sleepimage on Mac. It looks enormous, it seems hidden, and the natural instinct is to wonder whether you can just delete it. The honest answer is nuanced: you can remove it in certain situations, and on modern Apple Silicon Macs it may not even exist in the same form it once did. This guide walks through exactly what sleepimage is, where it lives, how much space it consumes, and how to make an informed decision about reclaiming that space.
What Is sleepimage?
sleepimage is the file macOS writes to your startup disk when the system enters Safe Sleep (also called hibernate mode). Before the Mac powers down all hardware, the kernel dumps the entire contents of RAM to this file. When you reopen the lid after a deep sleep or after the battery runs out completely, macOS reads the file back into memory and resumes exactly where you left off — open apps, unsaved documents, and all.
Think of it as a RAM snapshot on disk. If your Mac has 16 GB of RAM, sleepimage can be up to 16 GB. If you have 32 GB or 64 GB, the file grows accordingly. On older Intel MacBooks that relied heavily on hibernate, this file was critical for data safety after battery exhaustion. On Apple Silicon Macs the behavior has changed significantly, but the file can still appear.
Where Is the sleepimage File Located?
sleepimage lives in a protected system directory. You will not find it in your home folder or in ~/Library. The path is:
/private/var/vm/sleepimage
This folder (/private/var/vm/) also contains other virtual-memory swap files named swapfile0, swapfile1, and so on. Those swap files are active and should never be deleted while the system is running. sleepimage, by contrast, is written only at sleep time and read only at wake time, so it is idle whenever the Mac is fully awake.
Because the path lives under /private, Finder hides it by default. To navigate there in Terminal, use:
- Open Terminal (Applications → Utilities → Terminal).
- Type
ls -lh /private/var/vm/and press Return. - Look for a file named
sleepimagein the listing.
How Much Space Does sleepimage Use?
The file is almost exactly the size of your installed RAM, because it must hold a full memory snapshot. The table below gives typical sizes across current Mac configurations.
| Mac Model | Installed RAM | Typical sleepimage Size | Sleep Mode Default |
|---|---|---|---|
| MacBook Air M2 / M3 / M4 | 8 GB | ~8 GB | Safe Sleep disabled by default |
| MacBook Pro M3 / M4 | 16 GB | ~16 GB | Safe Sleep disabled by default |
| MacBook Pro M3 Max / M4 Max | 48 GB | ~48 GB | Safe Sleep disabled by default |
| Intel MacBook Pro (2019–2021) | 16 GB | ~16 GB | Safe Sleep enabled (mode 3) |
| Intel iMac / Mac mini | 16–64 GB | ~16–64 GB | Hibernate disabled (mode 0) |
On Intel portables, Safe Sleep (mode 3) is the factory default, so sleepimage is actively used and can occupy a substantial chunk of a smaller SSD. On Apple Silicon Macs, Apple switched the default hibernate mode and the file may be absent or zero-byte. Desktop Macs (iMac, Mac Pro, Mac mini, Mac Studio) default to hibernate mode 0 and generally do not maintain a sleepimage at all.
Apple Silicon vs Intel: Key Differences
The way Apple Silicon handles sleep is meaningfully different from Intel:
- Apple Silicon (M1 and later): The unified memory architecture and extremely efficient power states mean the Mac can hold memory state in low-power hardware modes without writing everything to disk. Apple ships these Macs with Safe Sleep effectively disabled by default (
hibernatemode 0or3with the write suppressed). A sleepimage file may exist but often sits at near-zero size or is absent entirely. - Intel MacBooks: Safe Sleep (mode 3) is the default. macOS writes a full RAM snapshot on every sleep cycle. If you never cleaned it up, this file has been sitting at full RAM size since the last time you slept the machine.
You can check your current hibernate mode by running this command in Terminal:
pmset -g | grep hibernatemode
A result of hibernatemode 0 means Safe Sleep is off — no snapshot is written and sleepimage is unused. A result of hibernatemode 3 means the file is actively maintained. Mode 25 is pure hibernate (writes to disk, powers off RAM completely) and is rare on modern Macs.
How to Safely Delete sleepimage (Step-by-Step)
Before deleting the file, you should disable Safe Sleep so macOS does not immediately recreate it. If you delete the file without changing the hibernate mode, it will be written again on the next sleep cycle.
- Open Terminal (Applications → Utilities → Terminal).
- Check current mode: Run
pmset -g | grep hibernatemode. Note the value. - Disable Safe Sleep (optional but recommended for desktops and plugged-in laptops):
Runsudo pmset -a hibernatemode 0and enter your administrator password. This tells macOS not to write a RAM snapshot to disk during sleep. - Delete the file: Run
sudo rm /private/var/vm/sleepimage. - Verify it is gone: Run
ls -lh /private/var/vm/and confirmsleepimageno longer appears (or appears as 0 bytes).
Important caveat for Intel MacBook users: If you rely on your laptop occasionally running to zero battery and resuming without data loss, keep Safe Sleep enabled (hibernatemode 3). In that case, accept the storage cost or free up space elsewhere. If you always have your charger nearby or use an Apple Silicon Mac, disabling Safe Sleep is a safe trade-off for most people.
If you later want to re-enable Safe Sleep, run sudo pmset -a hibernatemode 3. macOS will recreate the sleepimage file on the next sleep cycle.
Will Deleting sleepimage Cause Data Loss?
Deleting sleepimage does not cause immediate data loss in the sense of corrupting files you have saved to disk. However, it does remove the safety net that allows macOS to recover your open-but-unsaved work after a full battery drain. The practical risk depends on your hardware and workflow:
- Desktop Macs (iMac, Mac mini, Mac Studio, Mac Pro): These are always plugged in and do not hibernate in the traditional sense. Deleting sleepimage here carries virtually no risk.
- Apple Silicon MacBooks: The file is often not actively used anyway. Deleting it on these machines is generally safe.
- Intel MacBooks away from power frequently: If your battery sometimes hits zero, removing sleepimage means open apps restart rather than resume. Save your work before sleep if you disable Safe Sleep.
What Else Is Using Space in /private/var/vm/?
While you are in that directory, you may notice several swapfile entries. These are the macOS virtual-memory swap files and they are actively in use while the system is running. Do not delete them. They will grow and shrink automatically as the system needs to page memory to disk, and macOS cleans them up on restart. The only file in that folder that is safe to manually remove when the machine is awake is sleepimage itself.
If your Mac's System Data figure in About This Mac looks suspiciously large beyond sleepimage, you may want to look at what is actually inside System Data on macOS — caches, logs, and virtual-memory files all contribute. A tool like Crumb can audit all of these locations at once and show you what is safe before you delete anything.
Other Large System Files Worth Knowing About
sleepimage is often the single largest hidden file on a Mac, but it is far from the only one. After you have addressed it, consider:
- Xcode DerivedData: Stored at
~/Library/Developer/Xcode/DerivedData, this can grow to tens of gigabytes for active developers. - iOS Device Backups: Located in
~/Library/Application Support/MobileSync/Backup/, old phone backups frequently consume 20–60 GB or more. - User caches: Found under
~/Library/Caches, these accumulate from browsers, package managers, and app frameworks. - Log files: Stored under
~/Library/Logsand/private/var/log, these are usually small but can build up on long-running systems.
For a broader picture of where your gigabytes are hiding, the guide on how to free up space on Mac covers the full landscape of reclaimable storage across both user and system directories.
Quick Summary
sleepimage is a RAM snapshot that macOS uses to recover your session after a complete power loss during sleep. It lives at /private/var/vm/sleepimage and is exactly as large as your installed RAM. On Apple Silicon Macs it is often not actively used; on Intel MacBooks it is the default safety net. You can delete it safely if you also disable Safe Sleep with sudo pmset -a hibernatemode 0, with the understanding that you lose crash-recovery protection after full battery drain. Desktop Mac users have essentially nothing to lose by removing it.