RAM Disks

“Temporary high speed storage”

SuraSoft Featured 

Try eSearch
Suggested links

Pop up washer - eliminate pop ups

Introduction to Ram Disks

Clear your Temporary Internet and Cookie directories with the flick of a switch

You probably clear your cookies and temporary Internet files once in a while. Some clear it more often than others (for obvious reasons...;-). But if you've read our "Secure File Deletion" tutorial then you'll know that deleting files DOES NOT remove them from disk and it's quite easy to recover them. Then there is the persistent index.dat file that refuses to leave without a fight. - Are you paranoid? (hopefully you're not) but if you are or simply want to clear these "caches" of data with the flick of your reset button then the answer is RAM DISK!

Ram Disks are exactly as the name suggests. Using Ram Disk software you are able to assign part of your physical memory to act as a "drive" on your computer. You can then use this drive as any other drive on your system but the difference is the data is cleared no matter what upon a reboot (since all data on the RAM chip is lost). So you can see that the best things to store on a Ram Disk are your Temporary Internet files and Cookies. Every bit of persistent data will "vanish" without a trace when you want it to. There is also the added bonus of reduced disk activity and possibly enhanced performance.

You need to have plenty of memory to "mount" a Ram Disk. Remember every bit of RAM is important for the well being of your system and the bigger your Ram Disk the less memory that is available for your system. Get a decent RAM monitor and see how much free physical memory you have left during your normal day to day use of your computer. Then think how much space you'll require on your RAM DISK. It may be that you need a new stick of RAM for everything to work smoothly.

RAM Disk Software

For Microsoft Windows
Don't do anything silly like assigning large amounts of RAM for your disk as your system may suffer a royal stuff up. I also recommend more than 128MB of memory, preferably 256MB or more which easily available on modern systems.

Setting it up is pretty easy and you'll end up with a new drive with your choice of drive letter. (T:\ is a good one, it reminds you that its temporary). If you want more than just a simple Ram Disk then RamDisk9x/NT is the way to go.

For Linux based Operating Systems

On newer kernels (2.4 and above) simply issue this command as privileged user to create a dynamic RAM DISK that expands and contracts as required. Unlike older versions, memory is released back to the system after un-mounting. The kernel will expand the drive whilst balancing memory usage. For those that compiled the kernel without ram disk support you may need compile it again

mount none /mnt/ramdisk -t tmpfs

Your RAMDISK is now available for use at /mnt/ramdisk
/mnt/ramdisk must exist prior to mounting so create the directory

Using your RAM Disk!

After you install the Ram Disk software and have a new drive working it's time to move the caches over to it.

Internet Explorer
First lets set your IE Cache to be stored on your new RAM Disk.  Create a folder on your new RAM DISK where you want your Temporary Internet Files to be stored. Creating directories on your new disk is the same as on a normal hard disk.

Now click Start -> Settings -> Control Panel -> "Internet Options", click "Settings" and then "Move Folder". Browse to the folder you just created on your RAM DISK, move the disk space slider to a new value that is  less than your RAM Disk and then hit OK at all the prompts. Internet Explorer will recreate this folder upon every reboot.

Moving Cookies Dir
Moving your cookie directory to your RAM Disk a little harder. You'll have to edit these two keys in the registry so be careful.

Change the key values from the current cookie location to your new RAM DISK. A reboot is required for this change to take effect. You'll know if you've done it right as you'll be able to delete the "old" cookie location without Windows complaining.

You can move anything "temporary" onto your Ram Disk. All data will be lost permanently upon a reboot or system shut down. I recommend not moving your Windows "temp" directory to your Ram Disk because some software store data in there which may be required after a reboot. That's an incorrect way to use the temp directory but unfortunately many software titles do so.

Other Browsers
Mozilla/Firefox, Opera, Konqueror et al have simple user interface options to set Cache and Cookie locations so look at your particular browsers preferences menu.  

A ~30MB Ram Disk should be fine for tasks mentioned above, although if you have less than 128MB then it may actually be too big and will deny the system of valuable memory. If you have a lot of RAM such as 768MB or 1024MB you could make a massive 500MB RAM Disk. This will boost performance if you have to extract large amounts of data before installing it (there is virtually no "write/read" time on a RAM DISK). If you are a developer of software that creates lots temporary files at compile time then again this "large" RAM Disk method is good. Most Ram Disk software create drives with FAT16 as the file system hence the "disk" size is ~2GB (though I doubt most have this much to dedicate to a disk). Ram Disks work well in the NT/2000/XP environment as they have far superior memory management compared with the Win9x/ME product line.

As a final note never store important data on your Ram Disk as a system crash may mean a reboot and a reboot means loss of all data on the Ram Disk.