Run the little login program below and watch the boxes it has to hold in mind while it works.

The tiny program behind a login button

  1. 1typed = read_password_box()
  2. 2stored = load_hash(email)
  3. 3ok = matches(typed, stored)
  4. 4if ok: open_session()
  5. 5else: show("wrong password")

Memory (boxes)

empty — nothing has run yet

A program is a list of steps. Memory is a row of labelled boxes. Run it one step at a time and watch the boxes.

Those boxes are RAM: the computer's working memory, the desk it spreads things out on while a program runs.

Wikipedia: "Random-access memory is a form of electronic computer memory that can be read and changed in any order, typically used to store working data and machine code." Working data: the stuff a program needs right now.

Picture a desk versus a filing cabinet. RAM is the desk: fast to reach, but small, and swept clean when you leave (switch the power off and RAM is blank). Storage, the cabinet, is big and slow but keeps things when the power's off. That's the next lesson's file.

RAM vs storage

Speed

RAM (the desk)
Very fast
Storage (the cabinet)
Slower

Size

RAM (the desk)
Smaller
Storage (the cabinet)
Much bigger

Kept when power is off?

RAM (the desk)
No, wiped
Storage (the cabinet)
Yes

Used for

RAM (the desk)
What a program needs right now
Storage (the cabinet)
What's saved for later

Your graphics card has its own version of this, called VRAM, and it's the whole game for running AI models locally: a model has to fit in VRAM to run. Our VRAM calculator and best GPU for local AI are built entirely around that limit.

It's also why apps crash under load. Try to hold too much on the desk at once, every row, every full-size image, and you run out of memory. Load only what's needed and the desk stays clear.

Try it with the rules off. Run the login program and notice how few boxes it needs. Now imagine a program that tries to keep a million boxes on the desk at once. That's the moment a computer runs out of memory.

Check yourself

0/4 got it

Saved on this device only. No account, no streaks.

Next in what a computer does: What does a CPU do?.