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.
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:
Dynamic RAM (DRAM) stores data for only a tiny fraction of a second before losing it. To maintain stored data, the system must constantly refresh DRAM, which exacts a performance penalty and limits its speed. Typical DRAM provides 60 ns (nanosecond) access, but is inexpensive and consumes relatively little power.
Static RAM (SRAM) automatically maintains its contents as long as power is applied to it, without requiring refresh. SRAM provides access times an order of magnitude faster than DRAM, but is expensive and power-hungry.
PCs use a tiered memory architecture that takes advantage of these characteristics:
The bulk of a PC's memory uses DRAM (modern systems use a variant called SDRAM, described in the next section) and is called main memory. It is large—typically 256 MB to 1 GB or more—but too slow to keep up with a modern CPU. Main memory is where the CPU stores programs and data that it will soon need. Main memory functions as a buffer between the CPU and disk.
Cache memory is a small amount of fast SRAM that buffers access between the CPU and main memory.
Modern PCs have two layers of cache memory:
Primary cache memory, also called Level 1 cache or L1 cache, is typically 16 to 128 KB of very fast memory on the same chip as the CPU itself. L1 cache size and efficiency are major factors in CPU performance. The amount and type of L1 cache is determined by the CPU you use, and cannot be upgraded.
L1 cache is not large enough to eliminate the speed disparity between processors and main memory. Secondary cache memory, also called Level 2 cache or L2 cache, bridges that gap with a reasonable compromise between cost and performance. L2 cache is a part of the CPU package (or of the CPU substrate itself) on all modern processors, including the Intel Pentium 4 and Celeron, and the AMD Athlon 64 and Sempron. Modern processors have L2 cache memory sizes ranging from 128 KB to 2 MB.
Recent systems use main memory of one of the following types:
Synchronous DRAM, also called SDRAM, began shipping in 1996 and was commonly used on PCs until 2001. Unlike older and now obsolete asynchronous forms of memory, SDRAM shares a common clock reference with the CPU. The CPU and memory are slaved together, allowing the CPU to transfer data to and from memory whenever it wishes to do so, rather than requiring the CPU to await an arbitrary window. SDRAM speeds are specified in MHz rather than in nanoseconds, as was true of earlier forms of memory. Synchronous DRAM takes one of the following forms:
JEDEC SDRAM or PC66 SDRAM is so-called to differentiate it from the later PC100 SDRAM and PC133 SDRAM.
PC100 SDRAM is rated for use with Pentium II and Pentium III processors that use the 100 MHz FSB.
PC133 SDRAM is rated for use on a 133 MHz FSB. Note that you cannot safely assume that PC133 memory can be used to upgrade a system that has PC66 or PC100 memory installed. Some systems, particularly those based on the Intel 440BX and 810-series chipsets require PC100 memory and will not function properly with PC133 memory installed.
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.
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.
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.
Table 6-1. DDR2 characteristics
Chip |
Chip clock |
I/O clock |
Module name |
Module bandwidth |
---|---|---|---|---|
DDR400 |
200 MHz |
400 MHz |
PC3200 |
3,200 MB/s |
DDR2-400 |
100 MHz |
200 MHz |
PC2 3200 |
3,200 MB/s |
DDR2-533 |
133 MHz |
266 MHz |
PC2 4200 |
4,200 MB/s |
DDR2-667 |
166 MHz |
333 MHz |
PC2 5300 |
5,300 MB/s |
DDR2-800 |
200 MHz |
400 MHz |
PC2 6400 |
6,400 MB/s |
DDR2-1000 |
250 MHz |
500 MHz |
PC2 8000 |
8,000 MB/s |
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 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.