Random-access memory (RAM) is a volatile form of semiconductor data storage for computer and other electronics. Information stored in this kind of memory can be accessed and modified very quickly. However, a small amount of constant power is required to retain information. Also, this type of memory is relatively expensive compared to flash memory and disk drives, although this cost has decreased significantly from the early days of computers. For these reasons, it is generally used as temporary memory, which contains variables and values used by the operating system and other software for a short time. Any valuable information stored in RAM must be copied to non-volatile memory (which does not require power to retain information) before power is disconnected from the RAM, since the RAM resets when powered off.
RAM chips have continued to improve over time. As a result, there are a number of varieties of RAM, which are not reverse or forward compatible. Therefore, a newer computer using DDR3 could not use DDR2 from an older device.
In a typical computer, there are three basic kinds of memory. The first and fastest memory storage is offered by the registers. These are integrated into the CPU, and their information can be retrieved and updated incredibly quickly. The second kind is the RAM, which is also very fast, but slower than accessing the registers. Although the signals must travel across the motherboard to and from the CPU, the RAM is generally installed right near the CPU to expedite the process. After this comes the main memory, in the form of a hard drive or solid-state drive. This is an efficient form of memory which can contain all of the device's needed information, at a relatively low cost. In addition to these, external media can be used to offer further data storage.
The processor stores information it expects to need soon in the registers, and offloads the rest to the RAM. When data is needed which is not in the registers, it reaches out to the RAM to retrieve it. This does entail a short delay (in milliseconds) meaning that the processor must either stall (cease all work) or switch to a different task while it waits. If needed data is also unavailable in the RAM, then it must be pulled from the main memory. This is a particularly slow process with hard drives, since the platters must bring the needed data to the read head. Solid-state memory performs this task more quickly, since there is no such wait time. If the computer begins running out of RAM, it will also either wipe data it may need later but not at the moment, or offload vital data into a cache on the main drive; both of these options further reduce efficiency.