How Computers Work

RAM Explained

RAM is a computer's short-term working memory. Learn how it differs from storage, what happens when it fills up, and how much you typically need.

On this page
  1. What RAM is
  2. Short-term memory, not storage
  3. Why RAM is fast and forgetful
  4. How much RAM gets used
  5. What happens when RAM fills up
  6. Things that can help
  7. RAM compared with other specifications

What RAM is

RAM stands for random access memory. It is the space where a computer keeps the programs and data it is using right now. When you open a document, the file is copied from long-term storage into RAM, and the program works on that copy. When you open a browser, the program itself and every page it is showing live in RAM while they are in use.

The word “random” does not mean unpredictable. It means any location can be reached directly and about equally quickly, without having to read through everything before it, the way you would have to wind through a tape.

Short-term memory, not storage

RAM is often confused with storage, but they do different jobs.

RAM Storage
Purpose Working space for what is open now Keeping files and programs long-term
Speed Very fast Slower
When power goes off Contents are lost Contents stay
Typical size A few to a few dozen gigabytes Hundreds of gigabytes to terabytes
Cost per gigabyte Higher Lower

A useful comparison is a desk and a filing cabinet. The desk is where you spread out the papers you are working on. It is easy to reach but small. The cabinet holds far more but takes longer to fetch from. Closing a program is like clearing it from the desk; the original is still in the cabinet.

This difference is also why unsaved work is lost in a crash or power cut. Until you save, your changes exist only in RAM, which cannot keep anything without power. Many programs make temporary backups regularly to reduce this risk, but saving yourself is safer.

Why RAM is fast and forgetful

The common type of RAM in computers stores each bit as a tiny electrical charge in a very small component, and the charge leaks away quickly. The memory circuit therefore refreshes the charges many times a second to hold the data. Because of this constant upkeep, it needs power at all times. This design allows very quick reading and writing at a reasonable cost, and the price of speed is that the contents vanish when the power is cut.

The processor also has a few very small, very fast memory areas called caches built into it, which keep recently used data even closer. RAM sits one step further out, between those caches and storage.

How much RAM gets used

This matters for general computer performance, so it is worth knowing where memory goes. The operating system uses a share of RAM first, to run itself. Each program you open then takes some, and so does each browser tab, document or game. Programs may also keep extra data in RAM as a speed-up so they do not need to fetch it again. The operating system often uses spare RAM this way, to hold recently used files, because empty memory does no good. This means that seeing a high memory figure in a monitoring tool is not necessarily a problem by itself.

Needs vary with use. Light tasks such as browsing, documents and video calls generally need less than editing large photos or video, running virtual machines or playing demanding games. Phones and tablets manage memory more strictly and may close background apps to free space.

What happens when RAM fills up

When there is not enough RAM for everything that is open, the operating system has a fallback. It moves some data that is not being used right now out of RAM and onto the storage drive, in an area often called the page file or swap space. If that data is needed again, it is read back in.

This keeps things running, but storage is much slower than RAM, so the machine can start to feel sluggish. Typical signs include:

  • Pauses when switching between programs
  • Programs taking longer to respond or reopen
  • The drive activity light staying busy
  • Fans spinning up or the device warming as it works harder
  • In severe cases, programs that close unexpectedly or warnings about low memory

A computer that uses an SSD handles this better than one with a spinning hard drive, since the fallback is less slow, but it is still noticeably slower than having enough RAM.

Constant swapping to storage on a very full drive can make things worse, because the operating system needs free space for its swap area. Keeping some disk space free helps in this case as well.

Things that can help

If you suspect that memory is the problem:

  1. Close programs and browser tabs you are not using.
  2. Restart now and then, which clears out memory that programs have failed to release. Some programs gradually use more memory the longer they run, a fault known as a memory leak.
  3. Check which programs use the most memory with the system’s built-in activity monitor or task manager.
  4. Limit programs that start automatically when the computer boots.
  5. Consider adding more RAM if your device allows it.

Whether you can add memory depends on the device. Many desktops allow it. Some laptops have slots, while others have memory soldered to the board so it cannot be changed after purchase. Phones cannot be upgraded, and as with phone storage, what you buy is what you keep. Checking the specifications before buying is worthwhile, since choosing a little more at the start may be the only chance. Compatibility also matters: memory comes in different generations and speeds that are not interchangeable.

RAM compared with other specifications

More RAM does not make a computer faster in general. It prevents slowdowns that come from running out. Once there is enough for what you do, adding more makes little noticeable difference, and the processor, storage speed or graphics hardware matters more. When people compare computers, a sensible approach is to match RAM to your typical workload and then look at the rest, rather than treating a bigger number as automatically better.

On a graphics card, there is separate memory used only by the graphics chip. That is a different pool from the main system RAM discussed here.

The complete guide to how computers work

How a Computer Works: From Switches to Screens
Read the guide

Keep exploring

Guides from other topics

All topics →