How to Create and Use a RAM Drive on Windows | Windows OS Hub (2024)

A RAM disk is a virtual drive created in a free area of RAM that the OS sees as a normal local hard drive. The advantage of RAM Drive is its very high read/write speed (up to 10 times faster than SSD and up to 2-3 times faster than NVME M.2). A RAM disk can be used on computers with large amounts of RAM to store cache and temporary application files. Mostly RAM drive is used to store browser cache, temporary SQL databases, graphics or video rendering application cache, etc. This improves application performance and significantly offloads physical disks. The contents of the RAM disk are usually erased when the computer is restarted.

Contents:

  • Create a RAM Disk Drive on Windows 10 and 11
  • Creating In-Memory RAM Drive on Windows Server

Create a RAM Disk Drive on Windows 10 and 11

Windows 10 and 11 don’t have built-in tools for creating RAM drives, so you’ll need to use third-party apps(AMD RAMDisk, ImDisk, PassMark OSFMount, StarWind RAM Disk, etc.).

In this example, we will look at the open-source ImDisk Toolkit (https://sourceforge.net/projects/imdisk-toolkit/). Its advantages:

  • Free
  • Lightweight
  • There is no limit to the size of the RAM drive
  • Saves RAM drive files to the local disk when the computer is turned off.
  1. Download and install the ImDisk Toolkit program by running install.bat; How to Create and Use a RAM Drive on Windows | Windows OS Hub (1)
  2. Once the installation is complete, open the RamDisk Configuration shortcut on your desktop;
  3. On the Basic tab, you need to specify the size of the RAM drive(it is generally recommended that no more than 20-30% of the RAM should be allocated for this purpose), assign a drive letter, and choose whether the RAM drive should start automatically on Windows boot; How to Create and Use a RAM Drive on Windows | Windows OS Hub (2)
  4. You can use environment variables or symbolic links to automatically redirect TEMP folders to the RAM disk; How to Create and Use a RAM Drive on Windows | Windows OS Hub (3)
  5. Click Mount to enable RAM Drive. Open File Explorer and check that a new drive of the specified size appears;
  6. By default, the contents of the RAM drive are cleared when Windows restarts. You can automatically save the contents of the RAM disk to a local folder when you turn off the computer. To do this, go to the Data tab, specify the target directory, and check the option Synchronize at System Shutdown. The contents of this directory are copied to the RAM disk when the operating system boots. How to Create and Use a RAM Drive on Windows | Windows OS Hub (4)

You can move certain application caches to the RAM disk using Windows symbolic links. For example:

Edge Cache:
mklink /j "%userprofile%\AppData\Local\Microsoft\Edge\User Data\Default\Cache\" "R:\edge\Default\Cache"
mklink /j "%userprofile%\AppData\Local\Microsoft\Edge\User Data\Default\Code Cache\" "R:\edge\Default\Code Cache"
mklink /j "%userprofile%\AppData\Local\Microsoft\Edge\User Data\Default\Service Worker\CacheStorage\" "R:\edge\Default\Service Worker\CacheStorage"

Microsoft Teams Cache:
mklink /j "%userprofile%\AppData\Roaming\Microsoft\Teams\Cache\" "R:\ msteams\Cache"
mklink /j "%userprofile%\AppData\Roaming\Microsoft\Teams\Code Cache\" "R:\msteams\Code Cache"
mklink /j "%userprofile%\AppData\Roaming\Microsoft\Teams\Service Worker\CacheStorage\" "R:\msteams\Service Worker\CacheStorage"

Or you can change the cache path in the app settings. For example, to enable the Google Chrome browser to store data on a RAM drive, add the following parameter to its shortcut:

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

Google Chrome will cause less wear and tear on your SSD drive in this mode.

Check RAM drive read/write performance using the Crystal Disk Mark Tool. In this test, a DDR4 RAM disk’s read/write speed is 2-3 times faster than an SSD NVME M.2 drive.

How to Create and Use a RAM Drive on Windows | Windows OS Hub (5)

Creating In-Memory RAM Drive on Windows Server

In Windows Server, you can create a RAM drive without using third-party tools. You can use the iSCSI driver to allocate a part of the RAM on the server.

Install the iSCSI Target Server role using the Server Manager (File and Storage Services -> File and iSCSI Services).

How to Create and Use a RAM Drive on Windows | Windows OS Hub (6)

Open ports for the iSCSI service in the Windows Defender Firewall. You can allow access in the Windows Firewall graphical management console, or you can enable firewall rules using PowerShell:

Set-NetFirewallRule -Name MsiScsi-in-TCP -Enabled True
Set-NetFirewallRule -Name MsiScsi-out-TCP -Enabled True

How to Create and Use a RAM Drive on Windows | Windows OS Hub (7)

To allow traffic to the loopback interface for iSCSI, change the value of the DWORD parameter AllowLoopBack to 1 in the HKLM\Software\Microsoft\iSCSI Target registry key. You can change the registry parameter from PowerShell with a command:

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\iSCSI Target' -Name AllowLoopBack -Value 1

How to Create and Use a RAM Drive on Windows | Windows OS Hub (8)

Then create a 5GB virtual RAM drive:

New-IscsiVirtualDisk -Path "ramdisk:testRAM.vhdx" -Size 5GB

How to Create and Use a RAM Drive on Windows | Windows OS Hub (9)

Now you need to create an iSCSI target pointing to the IP address of your server (not localhost!):

New-IscsiServerTarget -TargetName targetRAMDisk -InitiatorIds @("IPAddress:10.1.1.200")

Connect the RAM disk to the created iSCSI target:

Add-IscsiVirtualDiskTargetMapping -TargetName targetRAMDisk -DevicePath "ramdisk:testRAM.vhdx"

How to Create and Use a RAM Drive on Windows | Windows OS Hub (10)

Go to Server Manager and select Tools -> iSCSI Initiator.

How to Create and Use a RAM Drive on Windows | Windows OS Hub (11)

Specify the IP address of your server in the Targets tab and click Quick Connect to add your iSCSI target.

How to Create and Use a RAM Drive on Windows | Windows OS Hub (12)

You can connect the iSCSI Target with the command:

Get-IscsiTarget | Connect-IscsiTarget

Now open the Disk Management Console (diskmgmt.msc) and check that you have a new 5GB drive. This is the RAM disk we created. Initialize the disk, create a partition and format it, and then assign a drive letter.

You can initialize a RAM disk and assign a drive letter using the built-in PowerShell cmdlets to manage disks and partitions.

Get-Disk | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel "disk2" -Confirm:$false

How to Create and Use a RAM Drive on Windows | Windows OS Hub (13)

Now you can move app files to the RAM drive and reconfigure your software to use it.

How to Create and Use a RAM Drive on Windows | Windows OS Hub (14)

When the server is restarted, the RAM disk is removed with all its contents and must be re-created.

Unfortunately, the test showed that the performance (iOPS) of a RAM disk created via an iSCSI target on Windows Server was almost 2 times lower than that of an ImDisk RAM disk.

Use the following commands to remove your RAM drive:

Remove-IscsiVirtualDiskTargetMapping -TargetName targetRAMDisk -DevicePath "ramdisk:testRAM.vhdx"
Remove-IscsiServerTarget -TargetName targetRAMDisk
Remove-IscsiVirtualDisk -Path "ramdisk:testRAM.vhdx"

How to Create and Use a RAM Drive on Windows | Windows OS Hub (2024)

FAQs

How to Create and Use a RAM Drive on Windows | Windows OS Hub? ›

Creating In-Memory RAM Drive on Windows Server

How to create a RAM drive in Windows? ›

Run ImDisk. On the Basic tab [1], select the size of RAM [2] you want to allocate to the RAM Disk. You can also opt for Dynamic Memory feature by checking 'Allocate Memory Dynamically' [3]. Leave the rest of the settings on default and click on OK [4] to create the RAM Disk.

How to use hard drive space as RAM in Windows 7? ›

Windows 7, Windows Server 2008 and Windows Vista:

Click Settings under Performance. Click the Advanced tab, and click Change under Virtual Memory. Select the drive to use to store the paging file. Select Custom size and set Initial size (MB) and Maximum size (MB).

How do I use internal storage as RAM on my computer? ›

It's under the “Virtual memory” header. This opens the Virtual Memory dialog, which is where you can configure how much of your hard drive will be used as RAM. Un-check “Automatically manage paging file size for all drives.” Now you can edit the options on this screen. Click your SSD drive.

How do I use disk space as RAM? ›

  1. Right Click “My Computer.”
  2. Click “Properties” on the contextual menu.
  3. On the left side, there should be an Advanced System Settings .Click it.
  4. Go to the “Advanced” tab.
  5. Under “Performance,” click “Settings.”
  6. Go to the “Advanced” tab on that screen.
  7. Under “Virtual Memory,” click “Change.”
Mar 8, 2023

Is RAMdisk faster than SSD? ›

RAM disks are created by partitioning capacity from system memory (aka RAM) using software, and they provide incredibly fast I/O (read and write) performance, many times faster than today's fastest SSDs, with wider bandwidth and extremely low latencies.

Why can't we use RAM as storage? ›

RAM is volatile, meaning it loses its data when the power is turned off or the system is rebooted. This makes it ideal for quick data access and manipulation, but unsuitable for long-term storage.

How do I access RAM storage? ›

Method 1– ctrl, shift, esc
  1. Press the following keys: Ctrl + Shift + Esc.
  2. The Task Manager should appear.
  3. Click on the “Performance” tab and check the section titled “Memory”

Can you use RAM instead of a hard drive? ›

Because RAM is a volatile storage device, most kinds of RAM on computers lost all data when it lost power. There do exist some software that can create a RAM disk for you to storage data. However, it is not recommended to store any valuable information on it just in case a power loss.

How do I make my RAM usable Windows 7? ›

What To Try
  1. Click Start. , type msconfig in the Search programs and files box, and then click msconfig in the Programs list.
  2. In the System Configuration window, click Advanced options on the Boot tab.
  3. Click to clear the Maximum memory check box, and then click OK.
  4. Restart the computer.

Is RAM the same as hard drive space? ›

However, the Random Access Memory (RAM) is temporary storage while the hard drive is the permanent computer storage, it lets you store data for a very long time, and its capacity is measured in Terabytes (TB) or Gigabytes (GB).

How do I install RAM drives? ›

To install the new RAM, align the notch on the RAM stick with the ridge in the slot, and firmly press the RAM into the slot until the side clips snap into place, securing the RAM. It's important to apply even pressure across the top of the module to avoid damaging the sticks or the motherboard.

How to create a RAM disk in Windows? ›

Creating In-Memory RAM Drive on Windows Server

Go to Server Manager and select Tools -> iSCSI Initiator. Specify the IP address of your server in the Targets tab and click Quick Connect to add your iSCSI target. Now open the Disk Management Console ( diskmgmt. msc) and check that you have a new 5GB drive.

How to install RAM yourself? ›

How to upgrade RAM on a laptop. To upgrade or add new RAM to your laptop, locate the RAM slot inside your computer and align the new RAM module to fit into position. Then, press down gently on the RAM cartridge until you hear a click signaling that the module has locked into the RAM clips inside your laptop.

How do I create a virtual RAM for my computer? ›

Procedure
  1. Access the System Properties settings. Go to Start > Run. Type sysdm.cpl and click OK. In the System Properties dialog box, click the Advanced tab. Under Performance, click Settings. In the Performance Options dialog box, click the Advanced tab.
  2. Adjust the virtual memory setting.
Apr 19, 2024

How do I create RAM space? ›

4 Steps to Free up RAM on Windows 11
  1. Disable Startup Programs You Don't Need. ...
  2. Stop Running Background Apps. ...
  3. Reduce Visual Effects. ...
  4. Track Memory and Clean Up Processes.
Sep 15, 2023

How do I create a ReadyBoost? ›

Insert a flash drive into one of the USB ports on your computer. Open File Explorer by clicking the yellow folder on the taskbar. Go to the ReadyBoost tab. Once Windows determines how much space can be used for ReadyBoost, choose Use this device and then OK.

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Barbera Armstrong

Last Updated:

Views: 6372

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.