PC Optimization #RAM disk#ImDisk#Windows 11

How to Set Up a RAM Disk on Windows 11

Learn how to create a RAM disk on Windows 11 using ImDisk or OSFMount to speed up temporary files, browser cache, and game shader caches.

6 min read

A RAM disk (also called a RAM drive) carves out a portion of your system RAM and presents it to Windows as a virtual hard drive. Because RAM operates at tens of gigabytes per second — far faster than even the fastest NVMe SSDs — any files stored on the RAM disk can be read and written almost instantaneously. This makes a RAM disk ideal for temp files, browser caches, game shader caches, and any other data that benefits from extreme I/O speed but doesn’t need to survive a reboot.

When a RAM Disk Actually Helps

RAM disks are most beneficial when:

  • You have 32 GB+ of RAM and rarely use more than 16 GB during normal workload
  • Browser cache: Chrome and Firefox disk cache hammers SSDs constantly — a RAM disk saves that wear and improves load times
  • Compile targets: Redirect compiler output directories to RAM for faster build cycles
  • Game shader caches: Some games repeatedly read/write shader caches — RAM speeds this up
  • Temp files: Windows TEMP can be redirected to reduce SSD write amplification

A RAM disk is not useful for game installation (too small, data lost on reboot) or storing primary project files (loses data if Windows crashes without flushing to disk).

ImDisk is a free, open-source RAM disk driver for Windows. The ImDisk Toolkit wraps it with a GUI.

Download and Install

Download ImDisk Toolkit from: https://sourceforge.net/projects/imdisk-toolkit/

Install it — no reboot required. You’ll get a new application called RamDisk Configuration in your Start menu.

Creating a RAM Disk

  1. Open RamDisk Configuration
  2. Click Create a RAM Disk
  3. Set Size: 4096 MB (4 GB) is a practical starting point
  4. Set Drive Letter: Choose an unused letter (e.g., R:)
  5. File system: NTFS for full Windows compatibility; exFAT for slightly faster small-file performance
  6. Allocation unit size: 4096 bytes (default) is fine for most uses
  7. Check Mount as removable drive — optional, some apps handle removable drives differently
  8. Leave Save RAM Disk Image unchecked unless you want to persist data across reboots (this defeats the purpose for caches)

Click OK. The drive appears in File Explorer immediately.

Auto-Create on Startup

In RamDisk Configuration, check Auto-save and restore if you want the RAM disk to be recreated automatically on each boot. Since it’s empty each time, Windows needs to reinitialize it — this adds a few seconds to startup.

Tool 2: OSFMount

OSFMount is another excellent free option from PassMark Software, with slightly cleaner UI:

Download from: https://www.osforensics.com/tools/mount-disk-images.html

  1. Open OSFMount → Mount new…
  2. Select Mount as virtual disk
  3. Choose RAM disk
  4. Set size (e.g., 4096 MB)
  5. Assign a drive letter
  6. Choose NTFS
  7. Click Mount

OSFMount doesn’t persist the RAM disk through reboots by default, so you’ll need to remount each session or create a startup script.

Redirecting Browser Cache to the RAM Disk

Chrome

Close Chrome completely, then create a shortcut with the following target:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disk-cache-dir="R:\Chrome Cache"

Create the folder first:

New-Item -Path "R:\Chrome Cache" -ItemType Directory

But since this directory won’t exist after a reboot until the RAM disk is created, make a startup script.

Firefox

In Firefox, type about:config in the address bar. Search for browser.cache.disk.parent_directory and set it to R:\Firefox Cache.

Alternatively, disable Firefox disk cache entirely (it uses only RAM cache):

Search browser.cache.disk.enable and set to false. This works if you have 16 GB+ RAM.

Redirecting Windows TEMP Folder

To move Windows temporary files to the RAM disk:

  1. Open System Properties → Advanced tab → Environment Variables
  2. Edit both TEMP and TMP under User variables:
    • Change both to R:\Temp
  3. Create R:\Temp on the RAM disk
  4. Click OK

For this to persist through reboots, you need a startup script that creates R:\Temp before any apps that use TEMP start. A simple PowerShell script added to Task Scheduler at startup works:

# Create-RamDiskFolders.ps1
New-Item -Path "R:\Temp" -ItemType Directory -Force
New-Item -Path "R:\Chrome Cache" -ItemType Directory -Force

Set this to run at startup via Task Scheduler with “Run with highest privileges” enabled.

Sizing Your RAM Disk

System RAMRecommended RAM Disk Size
16 GB1–2 GB (caution: less headroom)
32 GB4–8 GB
64 GB8–16 GB
128 GB+16–32 GB

Never allocate more than 25–30% of your total RAM to a RAM disk, or you’ll pressure the system during heavy multitasking.

Measuring the Benefit

Test speeds with CrystalDiskMark. Set the test size to 1 GiB and run it against both your NVMe and the RAM disk:

StorageSequential ReadSequential Write
Samsung 990 Pro NVMe~7,400 MB/s~6,900 MB/s
DDR5-6000 RAM Disk~35,000 MB/s~35,000 MB/s

The difference is stark. For workloads that involve lots of small random reads and writes (which browsers and compilers generate), the real-world speedup is even more noticeable than synthetic benchmarks suggest, since RAM’s latency is measured in nanoseconds vs. microseconds for NVMe.

A RAM disk is a practical upgrade for power users who want to squeeze extra performance from a RAM-rich system without spending money on hardware.

#SSD optimization #performance #Windows 11 #ImDisk #RAM disk