The advantages of a RAMdisk

ubuysa

The BSOD Doctor
Moderator
One of the things I see a lot in the builds that people spec up on here is a tendency to over-specify RAM. Now don't get me wrong, that's a good thing. RAM is a resource that you absolutely have to have enough of, running short of RAM is a total performance disaster. Ensuring that you specify enough RAM and then some is a very wise move. With 8 GB being the smallest RAM stick we typically see being specified however, the 'and then some' can be a big chunk of RAM.

Suppose for example, that your absolute maximum RAM usage with all your big RAM hungry apps running at once is 10.76 GB. Clearly you're going to have to specify 16 GB of installed RAM in your new build. What happens to the other 5.24 GB of RAM then? Well, Windows is very efficient at memory (RAM) management and it will try to use all the RAM you have installed if possible. It does this by assigning some RAM as Standby memory. Standby memory is RAM that nobody is currently using but which has been in use in the recent past. Windows keeps the contents of this memory alive in case another process wants that data in the near future. Simply allocating that memory to another process is a huge performance boost because it avoids the (lengthy) read from disk. Your extra 5.24 GB of RAM then will likely be assigned as Standby memory - but that's still RAM that's not being used at all at the moment.

I hate waste, I especially hate wasting stuff that is expensive - like RAM. If you're deliberately over-specifying RAM then finding something useful for some of that extra and largely unused RAM to do would be a bonus, but what can you usefully use it for?

You can use some of it to create a RAMdisk.

A RAMdisk is something that appears to Windows to be a regular disk drive but which actually writes to and reads from RAM. Obviously a RAM disk is going to outperform even the very fastest NVMe SSD we have today by a factor of about 10 - but at a cost. The cost is that RAM is volatile. When you shutdown the PC (or if you have a power failure) the contents of your RAMdisk are lost. Yes, it is possible to write the contents of a RAMdisk out at shutdown and load it on the next boot but that still won't protect you from data loss during a power failure.

This means that a RAMdisk is most useful for data that you can afford to lose. But do you have any data that you can afford to lose?

Yes you do. We all do. Every web browser uses a data cache. They're used to hold copies of pages (and images and data) that you've visited, so that if you go back to that page again it can be loaded from the cache, saving both the bandwidth and the time to download it again from the server. They make your browser 'snappier'.

If you lose the contents of a browser cache then all pages (and images and data) have to be loaded again from the web server, so you might notice a slight loss of 'snappiness' but everything will work perfectly normally. A browser cache then is a perfect candidate for storing on a RAMdisk. It will improve the performance of your browsing experience but it won't break anything if you lose the contents.

In addition, all browser caches are located on the system drive by default. These days the system drive is often an expensive NVMe SSD. What's even worse is that browser cache data consists of a large number of very small files that often change quite rapidly, this is exactly the kind of data you don't really want on an expensive SSD. Moving your browser cache to a RAMdisk will remove all these small writes and thus help to extend the lifespan of your system drive.

If you take a look at the size of your browser cache folders you'll see that they're usually quite small, a few hundred megabytes each, so even storing the cache files for several browsers doesn't require a RAMdisk to be any larger than about 1 GB in size.

There are people who believe that a RAMdisk is a waste of RAM and that with modern NVMe SSDs we don't really need them any more (they've been around for decades). However, in modern systems with more RAM than we can use and with expensive NVMe SSDs whose lifespan we want to extend as much as possible, a RAMdisk makes a useful contribution. What else are you going to use that unused RAM for anyway?

As an example, I have a 1 GB RAMdisk in my 16 GB system (with an NVMe system drive). I have the cache folders from four browsers that I use on the RAMdisk (and the two Windows Temp folders* as well) and I'm currently using only 584 MB of that drive. I still see lots of Standby memory in the 15 GB of RAM that's left, so nothing in the system is suffering because of the loss of that 1 GB.

There is a lot of RAMdisk software from which to choose, some are free, some are mostly free and some are paid-for. The one I use is free for a RAMdisk up to 4 GB in size and it has a name you can trust; the AMD Radeon RAMdisk.

You can download a user manual for the AMD Radeon RAMdisk from http://www.radeonramdisk.com/files/AMD_Radeon_RAMDisk_User_Manual.pdf. That will tell you everything you need to know about setting up and using a RAMdisk. You can download the software from http://www.radeonramdisk.com/software_downloads.php - choose the free 4 GB version.

There is also a very nice tutorial on setting up a RAMdisk and moving your browser cache to it at https://www.sevenforums.com/tutorials/312031-ram-disk-install-browser-cache-file-storage.html. It's written for Windows 7 but as far as I can see everything in there is still current.

I'm not advocating that we all set up a RAMdisk, I'm not even recommending that we all do it. But if you know you have unused RAM and you have an NVMe system drive then you have nothing to lose and something useful to gain.

*Moving the Windows Temp folders to a RAMdisk is not something I'd recommend unless you know exactly what you're doing and the implications of doing so. Although these folders are intended for data that is only required for this session, some apps use them as a semi-permanent data location and losing that data might be problematic. You also need to ensure that the Temp folders are cleaned of garbage often or you risk filling up a small RAMdisk with Temp data quite quickly.
 
Last edited:

ubuysa

The BSOD Doctor
Moderator
It is possible to move the location of the browser cache for Microsoft Edge too - as long as you're using the Chromium version of Edge (which everyone should be now following the latest updates). To move the Edge browser cache to your RAMdisk edit the shortcut that you use to start Edge and modify the Target to include the bit in bold here: "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --disk-cache-dir=your RAMdisk. Mine for example is "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --disk-cache-dir=X:\Edge.
 
Top