The TEMP/TMP environment variables specify the location in which most programs place temporary files. By default, TEMP/TMP location is in the Windows partition. To speed up the access, you may set the TEMP/TMP variables to a ram disk. Thus temporary files will be placed in the ram disk instead of the hard disk, avoiding the access the hard disk. This is also good for the life of a Solid-State Drive (SSD) by reducing wear.
If you want to set TEMP/TMP variables to the ram disk, you shall tick the checkbox Create "TEMP" folder automatically (see File System Features) when you create the ram disk. This makes a ram disk automatically create an empty folder named "TEMP" every time computer restarts. Otherwise most programs cannot find the TEMP path. Then you can set the variable values to X:\TEMP, here X is the drive letter of the ram disk.
a. Sometimes the ram disk may not have enough space to hold the temporary files, which cause some applications failed to continue working. This is because usually the size of a ram disk much smaller than a hard disk. Now one of the solutions for this issue is to create a large hybrid-disk. See Ramdisk, Hybrid-disk and File-disk.
b. Because a ram disk does not preserve its data across computer restarts if the Image File Feature is not enabled, the temporary files are automatically cleared after you restart the computer. Usually this is not a problem. But when you install new programs or do updates which require restart, sometimes error happens because setup/update program cannot find previous stored files in TEMP/TMP path after restart.