macOS RAM Disks Guide
A RAM disk is one of the oldest performance tricks on the Mac, and still one of the most effective. This guide
explains what a macOS RAM disk actually is, how the classic disk-image approach (diskutil /
hdiutil)
compares to the modern tmpfs one, how to create one, and how to keep your data safe when the disk
lives in volatile memory.
What is a RAM disk on macOS?
A RAM disk (also written RAMDisk) is a filesystem whose contents are stored entirely in your Mac’s memory instead of on the SSD. macOS hands it a normal path — sometimes even a normal volume name — so it looks like any other disk, except that reading and writing to it never touches storage hardware.
The practical consequences are simple. Because there is no storage-controller latency, IO-bound work runs dramatically faster (often 2–3× that of a fast NVMe drive) and produces no SSD wear. The trade-off is that RAM is volatile: when the machine loses power, the disk’s contents are gone.
diskutil, disk images and tmpfs: how macOS RAM disks are made
For years the practical way to create a RAM disk on macOS has been to attach a RAM-backed disk image from the
command line with diskutil image attach (previously hdiutil attach).
macOS 15 introduced a native tmpfs filesystem — a
memory-backed filesystem that grows and shrinks with its contents, much like Linux’s tmpfs.
There is also an older-school variant, mounting a disk image, which buys persistence at a
price.
Persistent RAM disks via disk images — and their two big drawbacks
Unlike the volatile ram:// device, a RAM disk backed by a disk image (a .dmg or
sparse image) can outlive an unmount: the image is a file, so its contents can be remounted later. That
persistence sounds appealing, but it carries two serious drawbacks — which is why we don’t recommend it:
-
It stacks layers of abstraction, and performance suffers badly. Every read and write has to
travel through the disk-image layer and the image’s own filesystem before it reaches memory, so most of the
speed edge you were chasing is given back. A
tmpfsRAM disk is a native, VM-backed filesystem — nothing sits between your app and RAM. -
It reserves the full size twice. A disk-image RAM disk reserves the entire volume size
both as the image on your disk and in RAM once it is mounted. A “10 GB” disk-image RAM disk
can therefore cost 10 GB of disk and 10 GB of memory up front — whereas with
tmpfsthe size is a ceiling that grows only as data is actually written.
Performance comparison: disk-image RAM disk vs tmpfs
Setup: A Mac Studio (M1 Max) with 64Gb of RAM running Blackmagic Disk Speed
Test.
The gap is significant.
| RAM disk solution | Read | Write |
|---|---|---|
| Disk image (persistent) | 3,498 MB/s | 1,240 MB/s |
RAM Folder (tmpfs, persistent) |
11,449 MB/s | 12,052 MB/s |
Same machine, same test: the disk-image RAM disk delivers about a third of the read speed — and roughly a
tenth of the write speed — of a tmpfs RAM disk.
That is the abstraction cost of the disk-image, block-device and filesystem layers stacked between your app and memory — and together they cost it most of the performance a RAM disk is supposed to deliver.
| Approach | How it works | Persistence | Notes |
|---|---|---|---|
diskutil image attach ram:// |
Volatile RAM-backed disk image, attached as a volume | None — gone on reboot | Quick and scriptable, but entirely manual |
| Disk-image RAM disk | RAM disk backed by a .dmg / sparse image file |
Yes — the image can be remounted | Layers of abstraction hurt performance; reserves the full size in RAM and on disk (for
.dmg files)
|
tmpfs (macOS 15+) |
Native filesystem over VM-managed memory, grows as needed | None by itself | No extra layers; size is a ceiling, not a reservation |
All three are raw building blocks. The disk-image route is the only one that persists on its own, but it pays for that in performance and memory — and none of the other methods save your work or remount automatically, which is exactly the gap a dedicated app fills.
How to create a RAM disk on macOS
With diskutil, previously hdiutil (command line)
A RAM disk is sized in 512-byte sectors, so a 4 GB disk is 4 × 1024 × 2048 sectors. Create,
format and mount it, then eject it when you are done:
This is fast to set up but entirely manual: every reboot you repeat it, and anything you forget to copy out is lost.
With RAM Folder (GUI + CLI)
RAM Folder uses the modern tmpfs backend and imports the
contents of a folder
you already use into the RAM disk, at the very same path, so there is nothing to migrate or reconfigure. It
also saves the disk’s contents back to storage and can remount at login:
Sizing a RAM disk: a ceiling, not a reservation
On a tmpfs disk the size you set is a ceiling, not a reservation. An 8 GB RAM
disk holding 300 MB of files uses roughly 300 MB of RAM: memory is consumed as files are written and released
as they are removed. It is safe to size a scratch disk generously “just in case”, as long as you do not
actually fill it — a disk that does fill up really does consume that much memory.
Does a RAM disk survive a reboot?
No — RAM is cleared on shutdown, restart and power loss, so a RAM-backed disk is empty or gone after a reboot. (The one exception is the disk-image RAM disk described above, which persists because its image is a file on disk — but that is exactly the approach that pays for persistence in performance and memory.) To keep your work, it has to be saved to real storage before the machine goes down.
RAM Folder performs that save at eject, at quit, and (optionally) on periodic snapshots, then remounts and refills the disk at login. A hard crash or power cut can still lose anything written since the last save, which is why the periodic snapshot exists — see the Data Safety notes for the details.
What a macOS RAM disk is good for
- Builds and caches — build outputs, package-manager caches and Xcode
DerivedData. - Developer scratch space — temp directories, unzipped archives, generated assets.
- Browser profiles — throwaway profiles that thrash the disk.
- Media work — audio and video intermediate files that are written and rewritten constantly.
- CI and automation — a fast, disposable filesystem that leaves no trace on the SSD.
macOS RAM disk apps compared
| Tool | Backend | Interface | Saves to disk | Mount at launch |
|---|---|---|---|---|
| RAM Folder | tmpfs |
Native GUI + CLI | Yes, automatic | Yes (can also launch at login) |
diskutil |
Disk image | Command line | Yes | Manual |
| TmpDisk | Disk image & tmpfs |
Open-source GUI | No (temporary by design) | Not built in |
| iRamDisk | Disk image | GUI | Varies | Varies |
| RAMDisk Manager | Disk image | GUI | Varies | Yes |
Third-party tools change over time — check each product’s own site for current features and pricing.
macOS RAM disk FAQ
What is a RAM disk on macOS?
A RAM disk is a volume whose contents live entirely in your Mac’s memory instead of on the SSD. Because RAM has no storage-controller latency, reads and writes are dramatically faster — and they cause no SSD wear.
How do I create a RAM disk on macOS?
You can create one from the command line with diskutil, or use the tmpfs filesystem
introduced in macOS 15. A dedicated app such as RAM Folder builds on the
tmpfs method — not a disk image — and wraps it in a GUI and CLI that also saves your data
back to disk.
Does a macOS RAM disk survive a reboot?
Not by itself. RAM is cleared on shutdown or restart, so the disk’s contents are gone unless they were saved to real storage first. Apps like RAM Folder save at eject and quit and can remount automatically at login, while importing back the contents of the RAM disk on mount.
How much RAM does a tmpfs RAM disk use?
Only as much as the data it holds. The size you set is a ceiling, not a reservation, so an 8 GB RAM disk holding 300 MB of files uses roughly 300 MB of memory.
Is a RAM disk faster than an SSD?
For IO-bound work, yes — often two to three times faster than a fast NVMe drive, and it produces no SSD wear. Large sequential transfers may be limited by the memory bus rather than the filesystem.
Can a macOS RAM disk be persistent?
It can, but the usual way — backing the RAM disk with a disk image — stacks layers of abstraction that hurt
performance (about a third the read and a tenth the write speed of tmpfs, see performance comparison above)
and reserves the full volume size both in RAM and on disk.
RAM Folder tmpfs RAM
disks avoid both; for
durability, saving the RAM disk’s contents to real storage (as
RAM Folder does at eject and
quit) and reimporting it when mounting it back is the
better approach.
A RAM disk that behaves like an ordinary folder
RAM Folder makes a macOS RAM disk so well-integrated it behaves like any other folder: same path, same name, no migration — and it saves itself back to disk or cloud storage. Two to three times faster than the fastest Mac drive, with a one-time €8.99 license and a 14-day free trial.
See RAM Folder →