Use A Ram Disk To Reduce Writes On Solid State Drives

The write speed of Solid State Drives is usually lower than the read speed. Many write operations on SSDs can slow down the system performance and reduce the longevity of the drive. Specialized programs such as SSD Drive Tweaker or Flash Fire aid the user in optimizing the system for Solid State Drives.

We have also covered tips to optimize Windows for Solid State Drives in the past which suggested among other things to move caches from the SSD to another drive.

That tip was problematic, especially for users with only SSDs connected to their computer.

A workaround for those users is to use a ram disk for caching purposes. Ram disks, sometimes also called ram drives, are storage devices that use computer memory to store the data.

This is obviously only a feasible alternative if the PC has enough system memory that can be spared for the ram disk. Any PC with three or more Gigabytes of computer memory should be able to run a ram disk for caching purposes.

This article covers the creation of the ram disk and explains how to move the cache from the SSD to the ram disk.

Using a RAM Disk

Windows users can select from a variety of Ramdisk applications. We have covered Ramdisk.sys in the past for instance but will use the Dataram Ramdisk software this time.

Update: The company has reduced the maximum from 4 Gigabyte to 1 Gigabyte. While that is still sufficient for many tasks, we suggest you try Ramdisk.sys or the last freeware version of Softperfect Ramdisk instead which you can download with a click on the following link: ramdisk_348setup.zip

The free version of the program supports ramdisk up to a size of 4 1 Gigabytes. This is sufficient for moving the cache to the ram disk and for most other uses as well.

Start the Dataram RAMDisk Configuration Utility after installation. The tool is listed in the Dataram Ramdisk start menu entry.

ramdisk

ramdisk

The ram disk is configured in the Settings tab. The size, file system and boot sector settings can be defined in here. How much memory should you turn into a ram disk? That depends on the memory installed and the required size of the caching directories. If the PC has 4 Gigabytes of RAM, you could set the RAM disk to 512 Megabyte for instance, and adjust it in one direction or the other if required.

One option to find out how much of the memory can be used is to open the Windows Task Manager by pressing Ctrl-Shift-Esc, switch to the performance tab and look at the physical memory section. Using half of the ram under the available section is usually a safe bet.

The file system can either be Fat16 or Fat32. Users who prefer NTFS or another file system need to select unformatted and format the disk in Windows after it has been created.

A click on Start RAMDisk will create the disk and assign a free drive letter to it.

ram disk

ram disk

The f: drive in the screenshot above is the newly created ram disk.

The second step of the process is to configure the applications and operating system to make use of the ram disk by changing the cache directories to a location on the new ramdrive.

We give examples for the Windows temporary file folders, Firefox and Internet Explorer caches.

Windows Temporary Folders

The Windows temp directories are stored in the system's environment variables. The easiest way to open the configuration window is by pressing Windows-Pause on the keyboard and selecting Advanced System Settings from the sidebar of the window that opens.

Locate the Advanced tab in System Properties and click on Environmental Variables. Here we have user variables and system variables.

environment variables

environment variables

Candidates here are for instance the TEMP and TMP system and user variables. They can be edited by selecting each one of them and clicking on Edit. Simply enter the new path in the variable value field and leave the variable name as it is.

changing windows temp folder

changing windows temp folder

Changing Firefox Cache

Open the Firefox web browser and type in about:config in the Firefox address bar. Enter browser.cache.disk.parent_directory in the filter field and double-click the parameter.

you need to create a new preference in Firefox for this to work:

  1. While on about:config, right-click in the main field and select New > String.
  2. Name that string browser.cache.disk.parent_directory.
  3. Double-click it afterwards, and enter the path that you want Firefox to use for its cache, e.g f:\cache
firefox cache location

firefox cache location

Internet Explorer Cache

Open Microsoft's Internet Explorer and click on Tools > Internet Options. The Internet Options are also accessible from the Windows Control Panel.

Click on Settings next to browsing history in the General tab and on Move Folder in the next window to move the temporary Internet Files folder to the ram disk.

temporary internet files

temporary internet files

There is another benefit of using a ram disk for caching locations. The ram disk will automatically be cleared on shutdown which makes recovery of those caching files afterwards impossible (unless a snapsnot of the ram is taken shortly after shutdown).

Solid State Drives benefit from the reduced write operations and it might even speed up some operations marginally.

Summary
Article Name
Use A Ram Disk To Reduce Writes On Solid State Drives
Description
The guide explains how you can use a RAM disk on your system to speed up operations and reduce writes on your Solid State Drives.
Author
Publisher
Ghacks Technology News
Logo
Please share this article

Facebooktwittergoogle_plusredditlinkedinmail



Responses to Use A Ram Disk To Reduce Writes On Solid State Drives

  1. ashmud June 10, 2010 at 3:34 pm #

    Changing the IE folder wouldn't "stick" between reboots on my Win7 (x64) machine. I had to use Junction (http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx) instead. Junction can be used to relocate Flash and Silverlight temp files as well.

    • Alex June 10, 2010 at 8:29 pm #

      Instead of symlinks, junctions and path changes, isn't easier to use Disk Management MMC interface and instead of assign a drive letter for the ramdisk, to map it as the desired folder?

    • nirvananow October 28, 2016 at 9:38 pm #

      Dead link !

  2. Arthur June 10, 2010 at 5:27 pm #

    There's absolutely no need to do this at all on modern SSDs. While the write speeds are lower than the read speeds, the former is still significantly higher than a standard HDD.

    • unekdoud June 10, 2010 at 5:42 pm #

      The issue here isn't about write speed, it's about wearing out the drive by writing too much. By relocating frequently written files (e.g. caches) off the SSD you will reduce the wear on the drive, and by placing them on the RAM it becomes faster (if I remember correctly, currently RAM is faster than SSD).
      Thus even if you don't have a HDD this tip is useful for increasing longevity of the SSD. On the other hand, if the computer has insufficient RAM than making a RAM disk will only worsen the situation.

      • Martin June 10, 2010 at 5:56 pm #

        That's right, it is mainly about longevity but also about performance if first generation SSDs are used which do not support Trim or garbage collection.

      • Arthur June 10, 2010 at 7:40 pm #

        If you have a decent SSD then the limited number of writes will honestly not be an issue for 99% of people. Take for example, the X25-M from Intel. This will last for a minimum of 5 years with 20GB of writes per day (http://goo.gl/aqCH)!!! A typical computer user will get nowhere near this figure.

        Moving caches and the page file off of the SSD is stupid because this is exactly what SSDs are good for. I could understand why you might do this if you had one of the first gen JMicron-based SSDs, but not any more.

  3. Nick June 10, 2010 at 8:51 pm #

    Could someone explain this to me. How come an SSD drive is limited in the number of writes it can perform?

    • Arthur June 10, 2010 at 9:12 pm #

      The article below explains how SSDs work and why they have write limits...

      http://www.anandtech.com/show/2829

      • Noah June 11, 2010 at 12:16 am #

        A link to a 25+ page article about every detail of SSDs is not really a great answer to the question! :P

      • Arthur June 11, 2010 at 12:35 am #

        Even though the article is very long it is definitely worth a read. Alternatively you can just skip to page 6.

    • Martin June 11, 2010 at 12:24 am #

      Use this then instead

      http://www.storagesearch.com/ssdmyths-endurance.html

      • Andrew Molloy June 11, 2010 at 2:31 pm #

        In simplest terms a "write" is essentially storing a charge in a cell, this charging "wears"/breaks down the insulator/silicon oxide a little bit each time and eventually breaks it down so it no longer "insulates" at all meaning there's no capacitance and hence no charge can be stored in that cell. How badly/quickly this happens depends on the configuration of the device to an extent but it's mostly a materials engineering problem. E.g. some organic hybrid flash cells I made only lasted about 1 or 2 cycles because the insulator was an organic material. :-)

  4. abhiroopb June 11, 2010 at 3:51 am #

    Hi Martin,

    I was wondering if you could help me figure out whether doing the things mentioned in this guide, or the things mentioned in https://www.ghacks.net/2009/01/10/optimize-windows-for-solid-state-drives-usage/ would actually be useful.

    The specifications of my setup (desktop) can be found here: http://www.techcomet.com/p/my-gadgets.html

    I generally, prefer to keep things "default" unless there is a real tangible benefit. For example, I have an i7 920 but I have not yet overclocked it. Right now I can run the latest games at the highest frame rates and I can run applications like Photoshop and Avid without any performance lost. Hence, I don't see the need to perform any tweaks.

    However, there are obviously times when things don't start up immediately and I have to wait a few seconds. So, I wanted to find out if the tweaks you have mentioned would be beneficial.

    I have a Intel X25-M MLC 80GB SSD, should I apply these settings? What would be the difference?

    Also, would you have any advice on Photoshop scratch disks? Should it be set to a SSD or my HD?

    What is your opinion of page files? I have read a lot of articles suggesting that it is on a separate partition. Is this valid reasoning?

    Sorry to use you like a help-file but you seem to know what you are talking about!

    • Martin June 11, 2010 at 9:43 am #

      Abhiroopb, I actually have the same SSD and would leave the configuration as is. If you run Windows 7 you are already using TRIM which helps reduce the wear leveling, if not I suggest you look at Intel's SSD Toolbox. My page file is on the SSD drive as it is the fastest drive on my computer, there would only be a benefit if you would have a faster drive as a secondary drive. If not, keep it there. I would generally say to leave everything as is if you do not experience slow downs while working with data that is stored on the SSD.

      https://www.ghacks.net/2010/03/01/intel-solid-state-drive-ssd-toolbox/

      • abhiroopb June 11, 2010 at 9:46 am #

        Thanks Martin!

  5. softsmyth June 11, 2010 at 2:40 pm #

    Moving the page file into a RAM disc is ludicrous ... your moving the area needed to buffer RAM (because RAM is low) into RAM....????

  6. Rodj June 11, 2010 at 3:27 pm #

    Ignoring SSD's entirely, if I have 8GB RAM on my Win7 64-bit system, would I get any benefit whatsoever by setting up a RAM drive as described in this article? Or does Windows essentially already do that for me behind the scenes with cacheing, etc.?

    • pceasies June 11, 2010 at 6:39 pm #

      Yes, setting up a 4GB ramdisk and putting your temp folders on it relieves disk usage and uses RAM's ultra fast speeds instead. It should give you some improvements in speed when multiple programs are open and using temp files. (Firefox, Photoshop, etc)

    • Arthur June 12, 2010 at 11:31 am #

      Don't bother with a RAM disk. Seriously. You will just make your computer *slower* because Windows will be forced to swap a lot more compared to if there wasn't a RAM disk.

      Read this post for a good explanation...
      http://arstechnica.com/civis/viewtopic.php?p=7772838#p7772838

  7. Marco June 11, 2010 at 3:39 pm #

    I'm using the described setup for about a year now with a 64GB SSD and a 2 GB RAM disc and 8GB memory in my machine. Works flawless and it is defintaly faster .. also you can use the ram disc for any other application which needs swap space, like photoshop and similar.... i can recommend this definatly!!

    • killer June 18, 2016 at 7:52 am #

      yes, this definitely makes sense. if you have 4GB or more of RAM, using RamDisk for the temp files will definitely help on the longetivity and slight performance boost of the system

  8. Faiakes June 12, 2010 at 4:23 pm #

    I have actually used this software and moved the Windows temp but it resulted in the system becoming unstable.

    Firefox, on the other hand, resides permanently, all of it, on the RAMdisk and works beautifully.

  9. mugabo June 16, 2010 at 12:45 am #

    Why not just disable all Firefox disk caching and use memory cache only?

    browser.cache.disk.enable false
    browser.cache.disk.capacity 0

    browser.cache.memory.enable 1
    browser.cache.memory.capacity [this is up to you, depends on your RAM]

  10. Faiakes June 16, 2010 at 8:20 am #

    The
    browser.cache.memory.enable is a true/false option

    The
    browser.cache.memory.capacity
    doesn't exist but needs to be created.

    I'll try

    • Don P. November 7, 2010 at 5:47 am #

      Faiakes you said "I ''ll try"
      So did you try?
      Tell us about your experience
      Thank you in advance

  11. joseph February 1, 2011 at 6:05 am #

    lol doesn't disabling browser cache make the swapfile cache instead? *anyhow i need to know a good 3rd party freeware ramdrive that starts in config.nt in windows xp x64 so i can have it preconfigured before login.

  12. alex March 27, 2011 at 7:22 pm #

    every time system boot ramdisk change letter depend on different attached usb external drive in my system (which happen quite offend). So my question is if ramdisk can assign letter, for example T:, whenever my system reboot. So my temp folder path won't be invalid.

  13. ghostdoc April 21, 2011 at 3:45 pm #

    A newbie question. I just started using Dataram and created a 4 Gb Ramdisk and just wanted to ask in your settings, do you have to check the box to "Load disk image at Startup (C:\Ramdisk.img) and Save Disk Image on shutdown(C:\Ramdisk.img) " ?
    When I check my local drive: C , I have two huge files (Ramdisk and Ramdisk.img.bak) which are 4 gb each.
    Thanks so much in advance.

    • Martin Brinkmann April 21, 2011 at 3:56 pm #

      I'm answering from memory so bare with me. As far as I understand the settings, they allow you to save the contents of the ramdisk to the computer so that they can be loaded again on the next system startup. If you want to start clean, you do not have to do that. If you keep data in the ramdisk that you want to save and access in the future, you may want to do that.

  14. john June 8, 2011 at 9:02 am #

    This is why SSD to me is a useless product, sure it's faster but it has very little value. You're paying considerbly more for considerably less space to get an increase in speed, this may in fact be a benefit worthwhile to many.
    However this benefit becomes completely diminshed because SSD have no longetivity; what's the point of spending all that money if you have waste your time using your new drive less? Sounds pointless to me lol. Once they figure out that problem and it becomes cheaper that it's worth switching.

    • queue April 8, 2014 at 4:46 am #

      SSD have no longevity? Useless product?
      The MHz wars are over. The battle to get data in and out of a CPU register continues.
      The funniest thing about your comment, is that you probably have never tried an SSD.
      It will change your life.
      Stop reading the internet, but more than that stop posting.
      You are not entitled to your opinion because it is comes from empty space.

  15. ssd4me July 19, 2011 at 10:41 pm #

    >SSD to me is a useless product

    Don't knock it if you haven't tried it. They are blazingly fast, deadly silent, and improve the user experience by an order-of-magnitude over spinning hard disks.

    And not only is a RAMDisk a good idea, it's a good idea for all PCs (at least, those that have RAM to spare). I put all Temp folders, IE, Firefox, and Tbird caches, Windows event logs, and etc. on mine and sleep well knowing the built-in thrashing that Windows gives storage is gracefully handled by RAM. The only time that part of your storage scenario enters the picture is when you shut-down your PC (and write the .img back to your SSD).

    Those who denigrate this idea don't know whereof they speak.

  16. real- July 21, 2011 at 3:54 am #

    Hi!

    I have a system with only SSD disks and would like to know how to put thunderbird cache on RAMdisk .

  17. ssd4me July 21, 2011 at 5:28 pm #

    >I have a system with only SSD disks and would like to know how to put thunderbird cache on RAMdisk .

    First create a directory on your RAMDisk and save it, e.g. MyThunderbird, then go to Thunderbird's Tools menu, select Options, and under General select Config Editor. Right-click anywhere inside there and select New String with the name

    browser.cache.disk.parent_directory

    and then enter your RAMDisk directory location w/double-slash e.g.

    R:\\MyThunderbird

    While you're there, you might want to look at browser.cache.disk.capacity and make sure it's a reasonable size given all you're putting on your RAMDisk.

    This article only shows a single backslash, while my surfing suggest double was necessary. In any case you'll want to test to make sure it works.

    After you restart Tbird it will place its Cache folder into the above. Note these about:config entries are the same as made for Firefox! Love Mozilla!

  18. real- July 21, 2011 at 7:27 pm #

    thx for the help!
    Ive done a couple changes fo firefox. First to disable disk cache and then to use memory.

    "browser.cache.disk.enable to set the value to False -> Right-Click anywhere -> New -> Integer -> Preference Name "browser.cache.memory.capacity" -> value memory size in KB. Enter 32768 for 32MB, 65536 for 64MB, 131072 for 128MB, etc. -> restart Firefox"

    So first I did this. then I found out about ramdisk and I did this:
    browser.cache.disk.parent_directory set to ramdisk.

    So is this all I need to do, or should I change browser.cache.disk.enable to "true" now since I use ramdisk ?

    thx

    • Martin Brinkmann July 21, 2011 at 8:16 pm #

      Well the ramdisk is not used if you do not enable the disk cache. At least that's what I believe needs to be done.

  19. Phil Robins January 19, 2012 at 11:30 pm #

    Worrying about the number of writes to an SSD and then adjusting your browser settings to reduce the writes through cache management would only make a difference if you were looking at millions (and I do mean millions of sites a day). MLC drives lifespan are roughly calculated at writing 200GB per day every day will last 6 years - SLC it's 500GB a day for 10 years. So for a 120GB SSD you'd have to completely overwrite the entire disk 1.75 times a day every day for 6 years before an MLC drive will fail. That is a hell of a lot of browser cache!

  20. Byron Wilson March 26, 2012 at 3:14 am #

    my situation is different - i've put a Kingspec 64GB PATA SSD into an old Thinkpad X40 (1.2Ghz Pent w/ 1 GB Ram) and i was wondering if there's any way to configure an SD card in the external SD slot as a RamDrive?

    in my (huge) ignorance i have no idea what pathways and bottlenecks are involved - but i'm looking to squeeze all the performance possible from this machine....

    • NorskeDiv May 9, 2012 at 5:29 pm #

      No, a RAM Drive is by definition a drive set up on RAM.

      You can use it as a readyboost drive. Click on it and then go to properties and then select "Use this drive for Readyboost," it may or may not be fast enough to do it. With only 1GB of RAM it will probably give a good boost in performance. I would recommend you look into upgrading your RAM as well. You could get at least 1.5GB in that thing. Replace the 512MB DIMM with a 1GB DIMM, it will cost you about $10 if you get it used on eBay.

  21. Olavo May 15, 2012 at 8:01 pm #

    Do I have to edit all variables in the "System variables" or just the TEMP and TMP?

    On my PC, %USERPROFILE% = C:\User\OLAVO and %SystemRoot% = C:\Windows. If I only type F: before %USERPROFILE% I have the path F:\ C:\User\OLAVO and If I only type F: before %SystemRoot% I have the path F:\C:\Windows.

    So I have to type F:\User\OLAVO in place of % USERPROFILE% and F:\Windows instead of % SystemRoot%, right?

    • John L. Galt August 5, 2012 at 11:42 pm #

      No, you do not want to change *all* of your variables, only those related to the %TEMP% and %TMP% entries.

      Changing anything else can (and most likely will) cause your login to temporarily / permanently stop working.

      Also, note that multiple drive letters in the same statement (and not separated by a separator like ";") will fail - you can't got to F:\C:\ - that is 2 different physical locations that you're trying to go to at the same time.

      • Olavo August 6, 2012 at 4:19 am #

        So I did it right.
        Thanks. :D

  22. Biffbart September 13, 2013 at 9:43 pm #

    Is a ramdrive still a good idea when considering what's available now in the world of controllers?

  23. Kampua February 20, 2014 at 2:45 pm #

    the search filter does not seems to work in Firefox anymore, what should I use?

  24. Marnes January 6, 2015 at 4:46 am #

    Imdisk > Dataram

  25. Jeremy December 3, 2015 at 10:32 pm #

    I did this and it's screwed up my comp. RAM disk will not start, it locks the comp, and now I can't access Environmental Variables to change the paths back to default. What to do please?

  26. Kelly Clubb February 13, 2016 at 2:58 am #

    Well I know not a lot of people have a ton of ram, but in my case I'm running 16GB which still isn't a ton now days but I run 4gb RAM for temps to save data usage on my 2 SSD drives on my system. I did a speed test and it comes down to a slightly faster ram drive, and for people that do not know about cache's or how to keep temps clean this is also useful, but additionally it's useful to extend the life of your ssd.

    I get about 20% increase on smaller files about about 100% increase on larger files from crystaldisckmark on speeds between ssd to ram (image the differance from spindle to ram lol

  27. Jimmy February 27, 2016 at 5:52 am #

    if i want to change it all back to defaults, what should i type in? there is no 'revert back to defaults' button in the Environment Variables section...??

    • John Galt February 29, 2016 at 12:06 am #

      You just change the location back to a non RAM drive, reboot, then stop the RAMdisk program from running and reboot again.

  28. paul February 3, 2017 at 11:02 pm #

    The firefox ~ "browser.cache.disk.parent_directory" appears to be hidden since Fx 45

    https://support.mozilla.org/en-US/questions/1115324

  29. RussiaFriend March 13, 2017 at 5:52 am #

    RAMDisk is very useful feature for old PC/Notebooks having none SSD. You should only ensure that you PC has enough RAM (~4GB). Creating of 450 Mb RAMDisk and putting the portable browser on it will speed up your web surfing significantly.

Leave a Reply