Taken from the help files of photoshop.
Code:
When your system does not have enough RAM to perform an operation, Photoshop and ImageReady use a proprietary virtual memory technology, also called scratch disks. A scratch disk is any drive or a partition of a drive with free memory. By default, Photoshop and ImageReady use the hard drive that the operating system is installed on as its primary scratch disk.
You can change the primary scratch disk and, in Photoshop, designate a second, third, or fourth scratch disk to be used when the primary disk is full. Your primary scratch disk should be your fastest hard disk, and should have plenty of defragmented space available.
The following guidelines can help you assign scratch disks:
For best performance, scratch disks should be on a different drive than any large files you are editing.
Scratch disks should be on a different drive than the one used for virtual memory.
Scratch disks should be on a local drive. That is, they should not be accessed over a network.
Scratch disks should be conventional (non-removable) media.
Raid disks/disk arrays are good choices for dedicated scratch disk volumes.
Drives with scratch disks should be defragmented regularly.
To change the scratch disk assignment:
Choose Edit > Preferences > Plug-Ins & Scratch Disks.
Do one of the following:
(Photoshop) Choose the desired disks from the menus. You can assign up to four scratch disks of any size your file system supports. Photoshop lets you create up to 200 GB of scratch disk space using those scratch disks.
(ImageReady) Choose a primary scratch disk.
Click OK.
Restart Photoshop or ImageReady for the change to take effect.
Important: The scratch disk file that is created must be in contiguous hard disk space. For this reason you should frequently optimize your hard disk. Adobe recommends that you use a disk tool utility, such as Windows Disk Defragmenter or Norton Speed Disk, to defragment your hard drive on a regular basis. See your Windows or Mac OS documentation for information on defragmentation utilities.
Hope it helps