Introduction
RAM, or random access memory, is the computer's working memory: the place where the operating system, running applications, and the data they are actively using are temporarily held so the CPU can access them quickly. Unlike storage devices, RAM is volatile, meaning its contents are lost the moment power is cut, which is why anything meant to persist, like a saved document, must be written to a storage device rather than left only in RAM.
Cricket analogy: A batter's short-term mental note of exactly which ball just got bowled and where it was hit, gone the instant the over ends and attention resets, mirrors RAM's volatility, while the officially recorded scorecard persisting after the match mirrors data written to permanent storage.
Explanation
RAM capacity, measured in gigabytes, determines how many programs and how much active data can be held at once without the operating system needing to swap less-used data out to much slower storage. RAM speed, influenced by its clock rate and timing specifications, determines how quickly the CPU can read and write that held data; a computer with ample fast RAM can keep more work close at hand and move it to the CPU faster, reducing the stalls that come from waiting on data.
Cricket analogy: A dressing room with enough lockers for the whole squad's kit means nobody has to shuttle gear to a storage van mid-match, like RAM capacity avoiding swaps to slow storage, while how quickly a kit manager can hand over the right gear when asked mirrors RAM speed.
There are two broad categories of RAM used inside a computer. Dynamic RAM, or DRAM, makes up the main system memory in most computers; it stores each bit using a capacitor that leaks charge over time, so it must be constantly refreshed to retain its data. Static RAM, or SRAM, is used for the CPU's cache instead, storing each bit using a small circuit that holds its state without needing refreshing, which makes it faster but also more expensive and physically larger per bit, so it is only used in small amounts.
Cricket analogy: A large squad list that needs the manager to re-confirm every player's availability every single week or the roster goes stale mirrors DRAM's need for constant refreshing, while a small core group of first-choice players whose status is simply known and stable mirrors SRAM's faster, no-refresh design used in smaller quantity.
Example
# Check installed RAM and current usage on Linux
free -h
# Detailed memory info
cat /proc/meminfo
# Show per-process memory usage
topKey Takeaways
- RAM is volatile working memory that holds actively used programs and data for fast CPU access.
- RAM contents are lost when power is cut, unlike data saved to storage devices.
- RAM capacity determines how much can be held at once without swapping to slower storage.
- RAM speed determines how quickly held data can be read and written by the CPU.
- DRAM makes up main system memory and needs constant refreshing; SRAM is faster and used in CPU cache.
Practice what you learned
1. What does it mean that RAM is volatile?
2. What happens when RAM capacity is insufficient for the active workload?
3. Which type of RAM is used for main system memory and needs constant refreshing?
4. Why is SRAM used only in small amounts, such as for CPU cache?
Was this page helpful?
You May Also Like
What Is the CPU
An introduction to the central processing unit, covering its internal parts, clock speed and cores, and the cache hierarchy that keeps it fed with data.
Storage Devices
How HDDs and SSDs persist data, why SSDs are faster for random access, and how capacity and interface choice affect boot times and transfers.
How a Processor Works
A closer look at the fetch-decode-execute cycle, pipelining, and the branch prediction and out-of-order execution techniques modern processors use.