RAM


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:

1.

Choose Palette Options from the Info palette menu.

2.

Enable Scratch Sizes and Efficiency and click OK (Figure 1.4).

Figure 1.4. Enabling Scratch Sizes and Efficiency in the Info Palette Options dialog box (left) displays them in the Info Palette (right).


3.

Open an image that's typical of the images you edit and perform several of the editing or correction steps you normally perform. It's important that the image be representative of the pixel dimensions and bit depth of the images you edit, too.

Take a look at the Info palette and interpret what it says in the following places:

  • On the Scratch line, the number on the left tells you how much RAM your open document currently uses. You'll see this number go up and down as you edit the image. The number on the right tells you how much RAM is available for Photoshop to use, which is set by the Memory Usage value in Preferences (I get to that in the next section, "Allocating RAM to Photoshop"). The number on the right can vary depending on other programs that may be running.

  • On the Efficiency line, see if Photoshop is operating at 100%. When Efficiency is below 100%, there isn't enough RAM for Photoshop to complete its work entirely in RAM, so Photoshop is starting to swap data between RAM and the scratch disk (Photoshop's own virtual memory), a process that slows Photoshop. If you typically see Efficiency at or near 100%, there's no immediate need for more RAM, but according to Adobe, if you consistently see an Efficiency value of 60% or less, you definitely need to add RAM.

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):

  • Number of pixels. If your first digital camera created 4-megapixel files, and your new camera creates 8-megapixel files, the images from the new camera require twice the RAM compared to images from the older camera. Here's another example: A typical print-quality image can be 3000 x 2000 pixels, but the same image sized appropriately for the Web may be 300 x 200 pixels, which means the print image contains one hundred times the number of pixels as the Web image. That results in a huge difference between the RAM requirements of each image.

  • Bit depth. 16-bit images consume twice as much RAM than 8-bit images.

  • Number of layers, masks, and channels. Adding a layer, mask, or channel literally adds another image to the image. An RGB color image can be triple the size of a grayscale version of the same image, because the RGB version contains three color channels while the grayscale version has only one channel (black). If an image starts out as a 8-bit RGB file without layers, and you add a layer to it, the file now contains two 8-bit RGB images.

  • Number of open documents. You can tell from the other items on this list that just one layered print-resolution image can easily consume the moderate amount of RAM that most computers come with out of the box (1GB or less). If you open multiple documents, and they're all rather involved, they can start to crowd each other out of your computer's available RAM.

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.

Adding a mask or channel increases file size less than adding an layer does, because a mask or channel consists of just one grayscale channel. Adding a layer requires adding all of the color channels used by the image. Adding a layer to an RGB image creates a 3-channel layer, while adding a layer to a CMYK image increases file size more because it creates a 4-channel layer.


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.

For complete, up-to-date information about the Photoshop RAM explanations in this chapter, see the Adobe tech note at:

www.adobe.com/support/techdocs/320005.html


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:

1.

Open Activity Monitor, which is in your Utilities folder.

2.

Click the System Memory tab at the bottom of the screen.

3.

Notice the readout for Free memory, indicated in green (Figure 1.7).

Figure 1.7.


4.

Watch the Free memory readout as you edit your images in Photoshop. If Free memory regularly falls below 20MB, consider lowering the Memory Usage percentage in Photoshop preferences as described later in this section. You can also install more RAM or run fewer programs alongside Photoshop.

To check the RAM performance of Photoshop on Windows XP:

1.

Right-click on the Taskbar and choose Task Manager.

2.

Click the Performance tab.

3.

In the Physical Memory section, notice the readout for Available memory (Figure 1.8).

Figure 1.8.


4.

Watch the Available Memory readout as you edit your images in Photoshop. If Free memory regularly falls below 20,000K, consider lowering the Memory Usage percentage in Photoshop preferences as described later in this section. You can also install more RAM or run fewer programs alongside Photoshop.

In Windows, advanced users can monitor RAM usage more precisely using the Performance utility, which is located inside Start menu > Control Panel > Administrative Tools. After it opens, click the Add button (plus sign) on the toolbar, select Memory from the Processor Object pop-up menu, select Available Mbytes from the list box, click Add, and click Close. The graph may be easier to read if you adjust the graph scale; right-click the vertical axis, choose Properties, and click Graph. Set the Maximum to a useful number such as the total number of megabytes of RAM installed in your computer.


To change the Memory Usage preference in Photoshop:

1.

Open the Preferences dialog box.

2.

Choose Memory and Image Cache from the pop-up menu at the top of the dialog box.

3.

Adjust the Maximum Used by Photoshop percentage value. It's best to make an adjustment 5% up or down from the current value, but avoid going above 75% unless you have more than 2GB of RAM installed. For more about that, see the topic "Using More than 2GB of RAM."

4.

Click OK and restart Photoshop.

5.

Monitor Photoshop performance as described earlier, and make another adjustment if needed.

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).


In this post on his blog, Adobe engineer Scott Byer describes in more detail how to monitor your Photoshop memory usage:

http://blogs.adobe.com/scottbyer/2006/03/reap_what_you_m.html

The Dashboard widgets in Mac OS X are convenient and fun, but don't go overboard with them. Dashboard widgets don't consume CPU power when they're hidden, but each one constantly occupies RAM, as you can observe in Activity Monitor. Dashboard runs as part of the Dock, so to quit all running widgets and release their RAM, select the Dock process in Activity Monitor and then click the Quit Process button in the Activity Monitor toolbar. Note that widgets don't load until you open Dashboard for the first time after logging in.


You may have noticed that the Memory Usage preference displays an amount of Available RAM that doesn't match the total amount of RAM in your computer. That's because there's always a base amount of RAM that Photoshop and other programs can't ever use because the operating system needs that RAM just to keep your computer running.

Some Mac users initially interpret the Memory Usage allocation to be similar to the memory allocation feature in the Get Info dialog box in the OS 9 Finder. That's not the case at all. In OS 9, the system allowed manual control of RAM allocation. In OS X, there is no system-level user control over RAM allocation. The Memory Usage preference in Photoshop is provided by Adobe, not OS X or Windows, and can only limit Photoshop RAM usageyou can never use it to give Photoshop more RAM than it could have obtained on its own.





Working Smart in Adobe Photoshop CS2
Working Smart in Adobe Photoshop CS2
ISBN: 0321335392
EAN: 2147483647
Year: N/A
Pages: 161
Authors: Conrad Chavez

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net