I was asked to explain how I setup to optimize my use of RAM on my personal computer. Here it is- a simplified explanation of my setup, The EASY Way:
Obtain the software (easy way uses commercial freeware which allows a RAMDisk up to 4GB, anything larger needs to be paid for) The harder method can do it all with freeware but it requires much more effort to setup.
1.
http://memory.dataram.com/products-and-services/software/ramdisk/ramdisk-purchase-and-download
2. The link to download the free version is obscured at the bottom of the page, just under the prices. When you click the link to download ‘RAMDisk here’ it will ask if you want to join the email group and then it will let you dowload the latest freeware copy (v4.4 at the time of this writing)
Install the RAMDisk software.
1. This installs the driver and will give you a Configuration utility.
2. Run the utility.
a. Note: the goal here is to create a RAMDISK that we can let windows use as a temporary files directory. As such if you have more than 6-8 gigs of ram I would set the RAMdisk to 2-4 GB. If you have more than 8 GB RAM, then you may want to look into a paid copy that allows you to use more ram for your disk, or use the slightly harder method that involves the freeware tool “ImDisk” not covered here.
b. If your RAMdisk is 4GB or smaller use FAT (Auto) for partition type. You don’t need security on the disk, or large file support. This of course can change if you have need of a larger RAMdisk.
c. Set the options to create a temp directory, label the disk .
d. Press the “Start RAMDisk” button at the bottom.
3. click on the “Load/Save” tab.
a. Remember the goal: this is a temp directory. We DO NOT want to save changes at shutdown (uncheck that box), but YES we do want to “Load Disk Image at Startup”.
b. Save the image by pressing the “Save Disk Image Now”. It defaults to C:\RAMDisk.img however this should be on your fastest hard disk drive. An SSD, Nand flash based, is prefered.
i. You must now edit the RAMDisk contents and windows variable settings. Remember where the “Save Disk Image Now” button was, as you will come back to it later.
Set Windows TEMP variables to point to the RAMDisk.
1. Open the RAMDisk in windows explorer
2. This drive should only have a “TEMP” directory in it now.
3. Right click your “My Computer” and select “Properties”
a. Select “Advanced System Settings” which opens a new dialog box with several tabs on it.
b. On the “Advaced” tab, at the very bottom, press the “Environment Variables” button.
i. There are 2 boxes, the ‘User variables’ and ‘System variables’
1. Locate the “TEMP” and “TMP” entries and change both to the path of your RAMDisk TEMP directory. You will do this for both User and System sections.
a. eg. I set my RAMDisk to drive letter X: therefore I set both variables to x:\TEMP
b. you can point these anywhere, even setting up an individual path for both, but you MUST also create the stated directory on your drive before you actually can use it. (meaning anything that you run that needs the temp variable will fail if you have not created the directory first)
ii. Press “OK” to accept the changes.
Set your favorite applications to take advantage of this super fast disk
1. As I prefer Mozilla Firefox, I will show how to set this up.
a. Create a new directory on your RAMDisk, call it “FireFox”
b. Type about:config into the location bar and press enter
c. Accept the warning message that appears, you will be taken to a list of preferences
d. Right-click somewhere in the list and select "New > String"
e. For the name of the preference type browser.cache.disk.parent_directory
f. For its value type the path to where you want to store the cache, eg the path to your directory “FireFox”.
g. Next locate the preference browser.cache.disk.enable, it must be set to true, if it is not, double-click on it to change its value.
h. Close Firefox and re-open it to allow it to create its cache in the directory.
2. You can do do this for all of your applications, especially servers, torrents, etc that write frequently to the disk.
a. You can place a small windows SwapFile of say 500MB here, turn it off your swap file on your NAND Flash SSD!
i. This may require changing some settings in the RAMDisk configuration, ie primarily the “save changes at shutdown” so that you can get windows to actually put a swap file on the RAMDisk and turn it off on your NAND Flash based SSD.
ii. Also, make sure you set a single 50 MB swap file to a spinning hard disk, so that should you run out of memory windows will ‘auto inflate’ this mini file and prevent itself from bluescreen crashing.
1. There are no known ways to prioritize swap files in windows. Keeping the RAMDisk with a 500 MB, and a spinning disk with a 50 MB swapfile is all you should need. Disable all other Swapfiles, unless you know for certain you need it elsewhere. You MUST have a swapfile in windows for full performance features, disabling it completely can slow your system or even make it unstable.
iii. If you are trying to make this small swap file on the RAMDisk, can properly get windows to save it, but on reboot windows spits out an error and generates a huge swap file on your OS drive then you will need to manually turn of hibernation. Note the swap file will be hidden by default so you must be showing hidden files to see it.
1. To disable hibernation:
a. Open a cmd.exe running it as administrator
b. Type powercfg.exe /hibernate off
c. Press enter and reboot your computer.
d. You may have to re-setup your swap file sizes and reboot again.
b. Do not place any log files, etc that you want to keep for long term storage as we are optimizing this setup to clear all changes on reboot.
Save your RAMDisk configuration to image
1. Return to the RAMDisk configuration tool to save the image by pressing the “Save Disk Image Now”. It defaults to C:\RAMDisk.img however this should be on your fastest hard disk drive. An SSD, Nand flash based, is prefered.
2. If you put it on a drive that is NTFS formatted, you can take advantage of NTFS file compression.
a. Right click the “RAMDisk.img” file and select properties.
b. At the “General” tab, very bottom select the “Advanced” button.
i. Check the box for “Compress contents to save disk space”.
ii. My 4GB file compressed down to 100 KB, which makes for a VERY FAST boot up.
Other optimizations I suggest googling the registry entries for:
AlwaysUnloadDll 1
DisablePagingExecutive 1
EnablePrefetcher 3
LargeSystemCache 1