Chapter 6. Memory

Computers use memory, also called main memory or RAM (Random Access Memory), to store active programs—including antivirus scanners and other background services—and the data the system is using at the moment. Data can be written to and read from RAM extremely quickly—roughly a million times faster than a hard drive—but data in RAM is retained only while the system is running. RAM costs hundreds of times more than hard disk storage, byte for byte, so RAM is not an economically practical substitute for hard disk storage.

The characteristics of RAM and hard disk storage are complementary. The hard drive stores programs and data that are not currently being used, for which large capacity and permanence are important but speed is not. RAM stores active programs and data, for which access speed is important but smaller capacity and transience are not.

That's not to say that the amount of RAM you have installed in your computer is unimportant. Far from it. If your computer has insufficient RAM to hold all of your active programs and data, it slows down—sometimes dramatically. This problem occurs when the operating system must swap out active programs and data from memory to the hard drive to make room for other programs and data. In extreme cases, such as running Windows XP with several active programs in a system with only 128 MB of RAM, performance may drop to literally 10% of what it would be on a system with sufficient RAM.

Unfortunately, many commercial systems—particularly inexpensive consumer-grade models from big-box stores and online vendors such as Dell and Gateway—are sold with insufficient RAM. We checked the Sunday supplements as we started this chapter, and found that many Windows XP systems were being offered with only 256 MB of RAM and some with only 128 MB. That's a sick joke. Windows XP requires a minimum of 256 MB of RAM to load and run just one or two programs with top performance, and it really wants much more. We recommend the following amounts of RAM for a Windows XP system:

Regard these as baseline figures, and increase them if you run a memory-intensive application or if you run many apps simultaneously. For example, we'd equip even a budget system that was to run Photoshop with at least 1 GB of RAM.

Robert recently experimented with the amount of memory in his main working desktop system, which uses one of the fastest processors available. That system often has many windows open—a dozen or more instances of the Mozilla browser, several StarOffice documents, his mail client, a PIM, and so on. (Robert runs Linux, which manages memory more efficiently than Windows, but the principle is the same.)

With 512 MB of RAM, performance was acceptable (as well it should be on a system with a $1,000 processor). But boosting the RAM to 1 GB paid immediate dividends. Programs loaded noticeably faster, and the lags in switching between programs disappeared. Everything became a lot snappier. Figure 6-1 shows why. At the moment this screenshot was captured, just the top three memory-consuming processes were using about 317 MB, 149 MB, and 136 MB of RAM—about 90 MB more than the 512 MB of RAM that was originally installed on this system. About 83 MB of physical RAM remains available, and only 368 KB of the swap file is in use. This system is running happily, with essentially all of the active programs using RAM exclusively.

Boosting the memory in this system to 1.5 GB had little beneficial effect. Most of the physical memory was still being used—Windows and Linux both use all the RAM they can get—and the swap file usage was near zero, but there was no perceptible performance difference between 1.5 GB versus 1 GB. That might change with a different mix of applications, but for Robert's system as he typically uses it, 1 GB of RAM is the sweet spot.

Your system also has a sweet spot, and chances are that the sweet spot is higher than the amount of memory you currently have installed. Installing more memory is one of the easiest, cheapest, and most effective upgrades you can make to an older system, or even to a new model that has insufficient memory. In the rest of this chapter, we'll tell you what you need to know to upgrade your memory and to troubleshoot memory problems.

Memory usage on Robert's primary desktop system

Figure 6-1. Memory usage on Robert's primary desktop system

This chapter focuses on general-purpose memory, where PCs store programs and data that are currently in use, the pipeline that supplies data to and receives results from the processor. General-purpose memory, called read-write memory or Random Access Memory (RAM), must be readable-from and writable-to. Two types of RAM are used on modern PCs:

PCs use a tiered memory architecture that takes advantage of these characteristics:

Modern PCs have two layers of cache memory:

Recent systems use main memory of one of the following types:

In general, although PC66, PC100, and PC133 SDRAM modules are still available (although in limited distribution), any system that uses SDRAM is a poor upgrade candidate. The latest SDRAM systems are now more than five years old, and reaching the end of their service life. The fastest SDRAM systems, such as 1+ GHz Pentium III models, are still fast enough to serve in secondary roles, but the very high cost per megabyte of SDRAM makes it uneconomic to upgrade them other than by salvaging SDRAM memory from other old systems.

DDR-SDRAM

Relative to standard SDRAM, Double Data Rate SDRAM (DDR-SDRAM) doubles the amount of data transferred per clock cycle, and thereby effectively doubles peak memory bandwidth. DDR-SDRAM is an evolutionary improvement of standard SDRAM, which is now sometimes called Single Data Rate SDRAM or SDR-SDRAM to differentiate it. Because DDR-SDRAM costs essentially the same to produce as SDR-SDRAM, it quickly obsoleted SDR-SDRAM.

The chips used to produce a DDR-SDRAM memory module, called a DIMM (Dual In-line Memory Module) are named for their operating speed. For example, 100 MHz chips are double-pumped to 200 MHz, and so are called DDR200 chips. Similarly, chips that operate at 133 MHz are called DDR266 chips, those that operate at 166 MHz are called DDR333 chips, and those that operate at 200 MHz are called DDR400 chips.

Unlike SDR-SDRAM DIMMs, which are designated by their chip speeds, DDR-SDRAM DIMMs are designated by their bandwidth.

Their data path is 64 bits (8 bytes) wide. So, for example, a DDR-SDRAM DIMM that uses DDR200 chips transfers 8 bytes 200 million times per second, for a total bandwidth of 1,600 million bytes/second and is called a PC1600 DIMM. Similarly, DDR-SDRAM DIMMs that use DDR266 chips are labeled PC2100, those that use DDR333 chips are labeled PC2700, and those that use DDR400 chips are labeled PC3200.

The falling price of PC3200 DDR-SDRAM modules quickly obsoleted slower forms of DDR-SDRAM, although PC2700 modules remain in limited distribution. The limited availability of PC2100 and slower forms of DDR-SDRAM is not an issue for systems that use those slower variants, because PC3200 memory is backward-compatible with slower variants.

Any system that uses DDR-SDRAM is a good upgrade candidate. If it is not labeled, you can identify the speed and other characteristics of an DDR-SDRAM DIMM by checking the item number on the module on the manufacturer web site. DDR-SDRAM DIMMs use 184 pins and can be discriminated from 168-pin SDR-SDRAM and 240-pin DDR2-SDRAM memory modules by noting the number of pins and the position of the single keying notch. Figure 6-2 shows a DDR-SDRAM DIMM.

DDR2 SDRAM

By early 2003, the original DDR-SDRAM technology was fast approaching its limits. As AMD and Intel transitioned to higher FSB speeds, DDR-SDRAM has been hard pressed to keep pace. Mainstream DDR-SDRAM tops out at PC3200. Dual-channel DDR chipsets (which combine the bandwidth of paired memory modules) using PC3200 memory limit peak bandwidth to 6,400 MB/s. That matches the bandwidth requirements of a processor with a 64-bit (8-byte) wide memory channel operating with an 800 MHz FSB, such as mainstream Pentium 4 models, but as new processors are introduced, even dual-channel DDR-SDRAM will be unable to keep up with increases in processor bandwidth.

The long-term solution is DDR2 SDRAM. DDR2 incorporates a series of evolutionary improvements on standard DDR technology, including increased bandwidth, lower voltage (1.8V versus the 2.5V of DDR), lower power consumption, and improved packaging. Just as DDR-SDRAM doubled bandwidth over SDR-SDRAM when running at the same clock rate, DDR2-SDRAM doubles bandwidth over DDR-SDRAM by doubling the speed of the electrical interface. DDR2 DIMMs use a new 240-pin connector that is incompatible with the 184pin DDR-SDRAM and earlier connectors. Table 6-1 lists the important characteristics of DDR2-SDRAM, with PC3200 (DDR400) DDR-SDRAM shown for comparison.

Although Intel has pushed DDR2 hard since its introduction, initial uptake was slow for two reasons. First, DDR2 memory originally sold at a very high premium over DDR memory, sometimes as much as 200% to 300%. By late 2005, that differential had dropped to 15% or 20%, making DDR2 a more reasonable choice. Second, although DDR2 offers much higher bandwidth than DDR, it also suffers from much higher latency. In effect, that means that although DDR2 can deliver data at higher speed than DDR, it takes longer to start delivering the data. For applications that use primarily sequential memory access, such as video editing, the bandwidth advantage of DDR2 offers noticeably higher memory performance. For applications that access memory randomly, including many personal productivity programs, the latency advantage of DDR gives it the edge. DDR2-SDRAM DIMMs use 240 pins and can be discriminated from 168-pin SDR-SDRAM and 184-pin DDR-SDRAM memory modules by noting the number of pins and the position of the keying notch.

Rambus RDRAM

Rambus RDRAM is a proprietary RAM standard developed jointly by Intel and Rambus. Rambus RDRAM is packaged in modules called RIMMs, which is a tradename rather than an acronym.

There are three types of RDRAM memory, called Base Rambus, Concurrent Rambus, and Direct Rambus. The first two are obsolete, and were used only in devices like game consoles. All RDRAM memory used in PCs is Direct Rambus memory. RDRAM has been made in four speeds, designated PC600, PC700, PC800, and PC1066, although only PC800 and PC1066 remain available. As with DDR-SDRAM, RDRAM modules are named according to their bandwidth, but with a difference. RDRAM uses a 16-bit or 18-bit data path (versus 64-bit for SDRAM) to transfer two bytes at a time, versus the 8-byte bandwidth of DDR-SDRAM. Accordingly, PC800 RDRAM has a bandwidth of only 1.6 GB/s and PC1066 2.133 GB/s, much lower than that of DDR-SDRAM, let alone DDR2-SDRAM.

RDRAM also suffers from severe latency, and that latency increases as the number of RDRAM devices is increased. Although RDRAM offered potentially higher overall performance at the time it was introduced, faster and much less expensive DDR-SDRAM quickly obsoleted RDRAM for use in desktop systems. RDRAM-based systems are upgradable, barely, but weigh carefully the age of the system and the cost of additional RDRAM memory versus the cost of replacing the motherboard and using DDR-SDRAM or DDR2-SDRAM memory.

You can judge the type of memory likely to be present in a system by knowing that system's age. Figure 6-3 shows a timeline for the types of memory that have been installed in new systems over the last 10 years.

As of late 2005, the memory landscape for PCs appears to be predictable for the next couple of years. PC3200 DDR-SDRAM memory will continue to be used in low-end systems, and will remain widely available for those who are upgrading older systems. DDR2-SDRAM finally gained a foothold in 2005 for Intel-based systems, and as AMD introduces DDR2-compatible processors throughout 2006, DDR2 will become the mainstream memory technology, gradually replacing DDRSDRAM.