The term memory is often used too loosely, because there's more than one kind of memory in a computer, and it's important not to get them mixed up. The two kinds of memory we're most concerned with are random-access memory (RAM) and hard disk space.
RAM is the memory where your computer does most of its thinking. RAM comes as a set of chips on a small circuit board. In contrast, hard disk space is the memory where your computer stores documents, and I talk about that in the "Hard Disks" section later in this chapter. RAM is fast, so your computer and Photoshop do as much processing as possible using RAM, and therefore it's a good idea to install as much RAM as possible. The problem is that RAM is much more expensive per gigabyte than hard disk space, so not everyone can afford to install the maximum amount of RAM their computer can take. In some cases, the cost of the memory chips required to fill a computer to capacity with RAM is more than the cost of the computer itself!
How Photoshop Uses Memory
When you start Photoshop, it sets aside part of your computer's available RAM to use as its work area. If you start to do things that require more RAM than is available, Photoshop begins using hard disk space to extend its work area. Because large images require more RAM than small images, Photoshop will use your hard disk sooner with large images (such as high-resolution print images) than with small images (such as low-resolution images for the Web).
Using hard disk space as working memory is called virtual memory, to distinguish that use from hard disk space used simply for file storage. Virtual memory is nothing new; both Mac OS X and Windows XP use virtual memory so that running out of RAM doesn't mean you're out of memory. The only time you really run out of memory is if your hard disk is so full that there isn't enough room for virtual memory to stretch out. Photoshop creates its own virtual memory, separate from that of the operating system, because it works with files that are much larger than you typically work with on your computer.
Virtual memory can't always save you from not having enough RAM. Some filters and plug-ins can operate only in RAM, and if you run them on a large enough image, it's certainly possible for an out-of-memory alert message to appear. Adobe Camera Raw and Extract are two examples of plug-ins that must operate completely within RAM. If you use plug-ins and filters often, you'll probably need more RAM than someone who doesn't use those features.
If you're knowledgeable about RAM and curious about how Photoshop really works with RAM, you might find this interesting: Recent versions of Photoshop are designed to use virtual memory space as main memory, and to use RAM as a fast cache of what's in virtual memory. While that sounds backwards, it makes sense if you think about it. When Photoshop routinely handles more data than can fit in RAM, which is most of the time, Photoshop organizes the working data using virtual memory on disk, where there's more room, instead of in RAM. What does Photoshop put in RAM, then? It gives priority to the image data and Photoshop tools you're currently using. An advantage of this approach is that your RAM is completely dedicated to the part of an image you're actually editing. If you edit part of an image and don't come back to it, it can easily be moved to virtual memory to make your fast RAM available for whatever you've moved on to.
Do You Need More RAM?
To understand whether you've got enough RAM installed for Photoshop, use a few tools that are available both inside and outside Photoshop.
The Info palette in Photoshop can display key information about Photoshop's memory usage, but the information isn't displayed by default. Here's how to set up the Info palette for memory analysis:
Take a look at the Info palette and interpret what it says in the following places:
Where All That RAM Goes
A typical reaction to watching Photoshop memory readouts is "Geez, why does Photoshop use up so much RAM?"
Here are some of the most important factors affecting how much RAM Photoshop uses (Figure 1.5):
Figure 1.5. Examining an image (top left) compared to a smaller version of the same image (top right) using the first three status lines in the Info palette (bottom left and bottom right).
What does all this mean? For maximum efficiency, figure out the highest level of quality required for your workflow and stay within that range. If you can't afford the RAM and other hardware to accommodate the memory needs of your workflow, try to avoid creating files that are larger or more complex than necessary. This doesn't necessarily have to lower quality; for instance, if your workflow doesn't benefit from 16-bit images, stick with 8-bit images, and Photoshop will be much more responsive.
If you use system utilities such as Activity Monitor (Mac OS X) or Task Manager (Windows) to monitor RAM usage, you may have noticed that Photoshop grabs a lot of memory when it starts up. This has led some to believe, mistakenly, that Photoshop takes more RAM than it needs. Actually, the amount of RAM Photoshop "reserves" at startup isn't exclusive to Photoshop. If Photoshop needs that RAM first, it will take it and hold on to it until you exit the program, but if Photoshop isn't currently using it, the RAM is available to other programs.
Allocating RAM to Photoshop
There's one more factor that affects how much RAM Photoshop uses: the Memory Usage percentage in the Preferences dialog box. Everybody seems to have a slightly different idea of what this preference is and how it affects Photoshop performance and efficiency, and I'm going to try and set the record straight.
I've already covered how Photoshop starts to use hard disk space as working memory when you do things that require more RAM than is available. A side effect of this is that before Photoshop starts to use your hard disk, it will use all of your available RAM first. Sometimes you don't want that to happen; you may want to keep enough RAM free to smoothly run another program alongside Photoshop such as Adobe Bridge, Adobe InDesign, or Adobe Illustrator. That means you want to limit Photoshop's natural tendency to use all available RAM. And that is what the Memory Usage preference does (Figure 1.6). The Memory Usage preference doesn't allocate more RAM to Photoshop; instead, it limits the amount of RAM that Photoshop can have.
Figure 1.6. Use Memory & Image Cache preferences to fine-tune the balance between Photoshop performance and RAM usage.
You'll notice that the default percentage of the Memory Usage preference is 70%. Now, don't be tempted to top it off at 100%. Remember, Photoshop isn't the only program you're running on your computer. The operating system needs RAM to run, and so do all the more modest programs you probably use constantly without a second thought, like e-mail and chat programs, and your Web browser. If you set the Memory Usage preference too high, other programs may not run well. If you can't afford to install enough RAM to run everything efficiently, you have a choice. If you want other programs to run well on the same machine as Photoshop, lower the Memory Usage percentage in Photoshop. If you want Photoshop to run faster, run as few other programs as possible.
How do you know whether the Memory Usage preference should be increased or decreased? Answering that question puts us into geek territory, so if you're fine with watching statistics and graphs, read on. If not, leave the Memory Usage preference alone and move on.
To check the RAM performance of Photoshop on Mac OS X:
To check the RAM performance of Photoshop on Windows XP:
To change the Memory Usage preference in Photoshop:
To summarize, Photoshop starts with the amount of unused RAM in your computer and uses the Memory Usage preference to set the amount of RAM that it ultimately uses (Figure 1.9). Anything that doesn't fit in RAM goes to the scratch disk.
Figure 1.9. Photoshop can use the RAM left over after the operating system gets what it needs (left). If a Photoshop document requires more RAM than is available, parts of the document are shuffled in and out of virtual memory as needed (right).