Computer memory refers broadly to hardware used to hold information that a computing system needs to access, retain or manipulate. In the broadest sense, it can include registers, processor caches, main memory, firmware storage and other forms of electronic data storage, although technical discussions often distinguish primary memory from persistent storage. Memory is characterised by properties including capacity, latency, bandwidth, volatility, access mechanism, physical implementation and cost per stored bit. Volatile memory loses its stored contents when power is removed, whereas non-volatile memory retains information without continuous electrical power. The hierarchy of computer memory exists because no single technology simultaneously provides extremely low latency, enormous capacity, low cost and permanent retention.
The memory hierarchy places different technologies at different points according to speed, capacity and cost. Processor registers are extremely fast but very limited in capacity, followed by cache memory such as L1, L2 and L3. Main system memory, generally implemented using dynamic random-access memory, offers much greater capacity but higher latency. Persistent technologies such as flash memory provide non-volatile storage at substantially greater capacity but with different access characteristics. Operating systems can also use storage as virtual memory when physical RAM is insufficient, although storage is much slower than RAM. This hierarchy allows frequently accessed information to remain close to processing resources while larger quantities of less frequently accessed data reside farther away.
Computer memory technologies use several fundamentally different physical mechanisms. Dynamic random-access memory stores information in capacitor-based cells that require periodic refreshing, whereas static random-access memory uses bistable circuits and does not require the same refresh process while powered. Read-only memory historically referred to memory intended primarily for reading, although modern forms include programmable and electrically erasable technologies. Flash memory uses floating-gate or charge-trap transistor structures to retain information without power. Semiconductor memory differs from magnetic storage and optical storage in physical operation, although all can serve as places where digital information is retained or accessed.
Memory capacity is normally expressed using units such as bytes, kilobytes, megabytes, gigabytes and terabytes, although manufacturers and software can use decimal or binary interpretations of these prefixes. Memory performance involves both latency and bandwidth. Latency describes how long it takes for a requested operation to begin producing usable information, while bandwidth describes the rate at which data can be transferred once communication is underway. A system can therefore have high memory bandwidth but still experience significant latency for individual accesses. Workload behaviour matters because sequential transfers, random accesses, large working sets and cache locality place different demands on the memory subsystem.
Addressing is central to computer memory because processors and software need mechanisms for identifying where data is located. Modern operating systems generally provide processes with virtual address spaces rather than exposing raw physical memory directly. Memory-management units translate virtual addresses into physical addresses and enforce permissions such as read, write and execute restrictions. Pages and page tables allow memory to be allocated, protected and moved between physical RAM and backing storage when virtual-memory systems require it. Memory allocation is consequently not simply a matter of reserving arbitrary physical locations; it involves operating-system policies, address translation, protection, caching and resource management.
Memory reliability becomes increasingly important as capacity and density increase. Some systems employ error-correcting code memory, which stores additional information allowing certain classes of memory errors to be detected and corrected. Memory errors can result from electrical faults, defective cells, environmental radiation or other disturbances. Consumer systems may use memory without full error correction, while servers, workstations and mission-critical systems commonly use ECC-capable designs where reliability is important. Memory testing and diagnostic mechanisms can identify defective modules or cells. The importance of reliability depends on workload and consequences of corruption, because an undetected bit error in a casual application can have very different consequences from an error affecting financial records or scientific computation.
Computer memory is used across almost every computing domain, including personal computers, smartphones, servers, embedded controllers, networking equipment, vehicles and industrial systems. Embedded devices may use small quantities of specialised memory with strict power constraints, while servers can employ enormous memory capacities to support databases, virtual machines and in-memory analytics. Graphics processors use specialised high-bandwidth memory systems to supply large quantities of data to parallel execution units. Modern processors may also incorporate memory directly into packages or use advanced packaging to place memory physically close to computation. These approaches reduce communication distances and can substantially increase bandwidth for specialised workloads.
Memory should not be treated as synonymous with storage. RAM generally provides a processor-accessible working area whose contents are normally lost when power is removed, while storage technologies such as flash-based solid-state drives are designed to retain data persistently. Cache memory, RAM, ROM and flash memory also differ in purpose and physical behaviour despite all being semiconductor-based technologies. Memory technologies are selected according to required speed, endurance, capacity, volatility, power consumption and cost. Understanding computer memory therefore requires recognising the hierarchy of technologies and the different roles they play between immediate processor execution and long-term information retention.