Primary storage is a category of computer storage, often called main memory. Confusingly, the term primary storage has recently been used in a few contexts to refer to online storage (hard disk), which is usually classified as secondary storage.
Primary storage is used to store data that is likely to be in active use, so it is usually faster than long-term secondary storage. Today, many computers have cache memory located in between the central processing unit and primary storage in order to further increase speed.
A particular location in storage is selected by its physical memory address. That address remains the same, no matter how the particular value stored there changes.
Over the history of computing, a variety of technologies have been used for primary storage. Today, we are most familiar with random access memory (RAM) made out of many small integrated circuits. Some early computers used mercury delay lines, in which a series of acoustic pulses were sent along a tube filled with mercury. When the pulse reached the end of the tube, the circuitry detected whether the pulse represented a binary 1 or 0 and caused the oscillator at the beginning of the line to repeat the pulse. Other early computers stored RAM on high-speed magneticdrums.
A basic and generally accepted classification of memory is based on the duration of memory retention, and identifies three distinct types of memory: sensory memory, short-term memory, and long-term memory.
Declarative memory can be further sub-divided into semantic memory, which concerns facts taken independent of context; and episodic memory, which concerns information specific to a particular context, such as a time and place.
Autobiographical memory - memory for particular events within one's own life - is generally viewed as either equivalent to, or a subset of, episodic memory.
To properly implement virtual memory the CPU (or a device attatched to it) must provide a way for the operating system to map virtual memory to physical memory and for it to detect when an address is required that does not currently relate to mainmemory so that the needed data can be swapped in.
The decision of when to use cache and when to use mainmemory is generally dealt with by hardware so generally both are regarded together by the programmer as simply physical memory.
The modern solution is to use virtual memory, in which a combination of special hardware and operating system software makes use of both kinds of memory to make it look as if the computer has a much larger mainmemory than it actually does and to lay that space out differently at will.