Sub topic 7
Saving disk space with Optimize Mac Storage
This chapter assumes you have already turned on iCloud Drive and can find it in Finder. It also assumes you know what the cloud and progress icons mean. Chapter-level prerequisites are an Apple Account, basic use of Finder and System Settings, and a working idea of files and folders.
What the setting does
iCloud Drive keeps every file in the cloud. By default, your Mac also keeps a full local copy of each file. That is fine until your iCloud Drive is large, for example 300 GB of projects and video on a Mac with a 512 GB disk.
Optimize Mac Storage changes the default. With it on, the Mac keeps full local copies while it has plenty of free space. When space gets tight, macOS removes the local contents of some files. The file stays in Finder with its name, icon, size and dates, but the data now exists only in iCloud. Apple calls the remaining stub a placeholder. When you open the file, macOS downloads it again.
Two points are easy to miss:
- The Mac decides when to remove content. Turning the setting on does not shrink your disk usage right away.
- Removing a local copy is not deleting a file. The file is still in iCloud and still listed in Finder on every device.
How the Mac decides what to remove
Apple does not publish the exact algorithm. The documented behavior is that macOS removes files you have not opened recently first, and keeps recently opened files local. It does this only when free disk space falls below a threshold that macOS manages itself.
You cannot set that threshold. The same Mac can hold a full copy of a folder for months and then evict it in one afternoon after you install a large app.
The "Kept Downloaded" check comes from the next-but-one chapter's feature, Keep Downloaded. It is shown here because it overrides optimization. A file you mark that way is never removed to free space.
Turning it on or off
The setting lives in System Settings under your Apple Account name, then iCloud, then Drive. The label is Optimize Mac Storage. The layout of this pane has changed between macOS releases, so if you do not see the toggle on the first screen, look for an Options or Drive settings button.
Before you change it, check these two numbers:
- Your iCloud Drive size. In Finder, select the iCloud Drive folder and choose File > Get Info.
- Your Mac's free space. Open System Settings > General > Storage.
If you turn the setting off, macOS downloads everything in iCloud Drive that is not yet local. If the Drive is larger than your free space, the disk fills up. Sync then stalls or the Mac warns you about low storage. Turn it off only when your Drive fits on the disk with comfortable room to spare, which I would define as at least 20 percent of the disk still free.
What you see after files are removed
Files with removed content show a cloud icon with a downward arrow in Finder, in the Status column of List view, and in Open and Save dialogs. This is the "only in the cloud" state. The next chapter covers the icons in detail.
Some behavior follows from this:
- Opening the file downloads it. Large files take time, and with no network the open fails.
- Quick Look and previews may download the file. Browsing a folder in Column or Gallery view can trigger downloads of many files.
- Search still finds the file by name. Spotlight indexes the metadata, but content search depends on what Spotlight indexed before removal.
- Copying a placeholder downloads it first. Copying to an external drive forces a download of every file you copy.
Effects on other tools
Optimization is invisible to you but visible to other software. This table lists the effects most likely to surprise an intermediate user.
| Tool or action | What happens with cloud-only files |
|---|---|
| Time Machine | It cannot back up data that is not on the disk. Your iCloud copy is then your only copy of those files. |
| Command-line tools (`cp`, `rsync`, `tar`) | Reading a file triggers a download. Archiving a whole folder can download gigabytes. |
| Backup or sync apps | Same as above. Some skip placeholders, others download them. |
| Apps that scan folders (IDEs, photo tools) | They may trigger bulk downloads when they index a project. |
| Offline use | Cloud-only files cannot be opened. Plan ahead before a flight. |
| Disk usage reports | The folder can show a large logical size and a small size on disk. |
Time Machine deserves attention. If you rely on it as your only safety net, optimization means your backup is incomplete. Treat iCloud as sync, not backup, and keep a separate backup of anything important.
Checking from Terminal
You can see the effect from Terminal. The exact behavior of placeholders depends on your macOS version. Older releases show hidden .icloud stub files. Newer releases keep the real file name and mark the file as having no data on disk. The commands below work on both.
# Free space on the main data volume
df -h /System/Volumes/Data
# Size on disk of your iCloud Drive (cloud-only files count as nearly zero)
du -sh "$HOME/Library/Mobile Documents/com~apple~CloudDocs"
# Ask macOS to download one file now
brctl download "$HOME/Library/Mobile Documents/com~apple~CloudDocs/report.pdf"
# Ask macOS to remove the local copy of one file
brctl evict "$HOME/Library/Mobile Documents/com~apple~CloudDocs/report.pdf"du reports space used on disk, so a folder of cloud-only files looks small. ls -l reports the logical size, which stays large. When the two disagree, files are probably cloud-only.
brctl is a system tool meant for diagnostics. It is not a documented public interface, so its options can change between macOS releases. Use it for checking or one-off actions, not in scripts you depend on.
Common errors
- Expecting free space immediately. Turning the option on does not clear the disk. Space returns only when macOS decides it needs it. To free space on demand for one folder, use Remove Download in Finder (covered later).
- Assuming a placeholder is a broken file. A file with a cloud icon is healthy. If it does not open, check your network and sign-in first.
- Backing up with a script that downloads everything. Running
rsyncover the iCloud Drive folder can fill the disk with downloaded data. Ask yourself whether the files you copy will be evicted again. - Using Optimize Mac Storage as a quota fix. It saves disk space on the Mac, not iCloud storage. Your iCloud plan limit is unchanged.
- Confusing it with the Photos setting. Photos and Mail have their own optimization settings. This toggle only affects iCloud Drive files.
- Working offline without preparation. Files you need on a trip should be marked Keep Downloaded beforehand.
Deciding whether to use it
| Situation | Suggested choice |
|---|---|
| Small Drive, large disk | Leave it off. You gain little and lose predictability. |
| Drive nearly as large as your disk | Turn it on. Without it, sync can fill the disk. |
| Often offline, or you run tools over the whole folder | Keep it off, or mark key folders Keep Downloaded. |
| Shared Mac with limited space | Turn it on and keep only active projects pinned. |
| Mac is your only copy of important files | Keep a separate backup, whatever you choose. |
The trade-off is simple. Optimization gives you disk space at the cost of predictability: a file may or may not be local when you need it. If your workflow can tolerate a short download, it is a good default for small disks.
Exercise
Your Mac has a 256 GB disk and 40 GB free. Your iCloud Drive holds 180 GB. You turn Optimize Mac Storage off. What is likely to happen, and what would you do?
Show answer
macOS will try to download the roughly 140 GB of files that are not yet local, which is more than the 40 GB of free space. The disk fills up, sync stalls and the Mac warns about low storage. Turn Optimize Mac Storage back on, free up some space, and keep only the files you need offline pinned with Keep Downloaded.
Exercise
You run du -sh on your iCloud Drive folder and see 12 GB, but Finder's Get Info shows 90 GB. What explains the gap?
Show answer
Most files are cloud-only placeholders. du counts space on disk, so placeholders count as almost nothing. Get Info shows the logical size of all files, including those stored only in iCloud.