The notions of primary and secondary memory arise as part of the memory hierarchy
in a computer system. To understand the hierarchy, we must consider both performance
and cost: memory that has the highest performance characteristics is also the
most expensive. Thus, an architect must choose memory that satisfies cost constraints.
Research on memory use has led to an interesting principle: for a given cost, optimal
performance is not achieved by using one type of memory throughout a computer.
Instead, a set of technologies should be arranged in a conceptual memory hierarchy.
The hierarchy has a small amount of the highest performance memory, a slightly larger
amount of slightly slower memory, and so on. For example, an architect selects a small
number of general-purpose registers, a larger amount of primary memory, and an even
larger amount of secondary memory. We can summarize the principle: