Inside RAM: Which Kind is Right for You?

This site may earn affiliate commissions from the links on this page. Terms of use.

It used to be that the only question you really needed to know about system RAM was, “How many megabytes?” If only it were so simple today! While most of today’s systems use only a few major types of memory, there are numerous performance variations and cost differences. In addition, some motherboards permit memory timing tweaks, allowing you to tune your system for optimal memory performance.

The type of RAM that can be installed in your system is an important purchasing decision that affects performance, cost, and ability to upgrade. Understanding today’s memory performance landscape is the focus of this article.

The Memory HierarchyMemory is organized into several hierarchical levels. Main memory serves as a cache for the virtual memory swapfile stored on the hard disk. Level 2 (L2) cache lies between the actual processor die and main memory, and all processors have a fast L1 cache integrated into the processor die itself. The cache hierarchy makes sense because each level, from registers down to the hard disk, is an order of magnitude less expensive than the previous, and thus each level can be an order of magnitude larger than the previous. And because the fundamental principles behind caches work well, data storage systems in modern computers come very close to having the speed of registers and the size of a hard disk.

The fundamental principles of cache design are the Principle of Temporal Locality and the Principle of Spatial Locality. The Principle of Temporal Locality states that once a program references a particular memory location, it is likely to reference that same memory location again. The Principle of Spatial Locality says that a program tends to reference memory locations that are near each other–but not necessarily in sequence.

When a cache receives a request for data it doesn’t have, this event is known as a cache miss. A compulsory cache miss always happens the first time the processor requests an application’s code or data. Compulsory cache misses are also known as cold start misses or first reference misses. Sometimes cache misses occur because the program references more data than the cache can hold, and so blocks of data are thrown out and later retrieved–this type of cache miss is called a capacity miss.

A third type of cache miss, called the conflict miss, happens because the addressable memory space for a 32-bit system is 4 gigabytes–so 4 gigabytes’ worth of address space has to be mapped into a small space, be it the size of system RAM, the size of the L2 cache, or the size of the L1 cache. Caches must use very efficient algorithms such as hashing to place and find data; unfortunately, this means that occasionally a cache will replace data it will need later on before the cache is full.

The reason for all of this description is to put memory into perspective: System memory is designed with the sole purpose of minimizing the effect that the slow speed of main and virtual memory have on overall system performance. But how much effect it has depends on the pattern of cache misses in the software you use.For example, a program that’s slightly larger than your system’s L2 cache could be more affected by main memory performance than one that’s half the L2 cache size, because the former program’s larger size will cause capacity misses in the L2 cache which won’t happen with the smaller program. The more capacity and conflict cache misses you have, the more important system memory speed becomes.

With the advent of these new memory technologies, it’s suddenly a lot more difficult to know which solution is the “best.” People have had some pretty vicious arguments over whether DDR SDRAM is better than Direct Rambus DRAM, or even if it really matters. On top of that, the legal battles of the companies who make these technologies add an emotional element to the debate, and listening to their advocates argue is about as entertaining as getting stuck in an elevator for two hours with a sheep farmer who hasn’t bathed in three months.

People disagree so much because the best answer to the question, “What’s the best solution for me?” is: “It depends.” It depends on what you’re doing with the computer. Now all sides can probably agree that it depends, but that answer isn’t very helpful to someone who wants to know what kind of memory he or she should buy. Looking at all of the benchmarks and white papers in the world is worthless without taking into consideration the software you’re running and how it behaves.

We’ve briefly covered cache hierarchy, so now we’ll cover the two key performance factors of RAM, bandwidth and latency. Finally, we’ll investigate how bandwidth and latency affect performance for different types of software.

This site may earn affiliate commissions from the links on this page. Terms of use.

ExtremeTech Newsletter

Subscribe Today to get the latest ExtremeTech news delivered right to your inbox.

Email

This newsletter may contain advertising, deals, or affiliate links. Subscribing to a newsletter indicates your consent to our
Terms of Use and
Privacy Policy. You may unsubscribe from the newsletter at any time.