DEV Community

Ben Halpern
Ben Halpern

Posted on

Explain "memory" like I'm five

What is this memory stuff and how does it work?!?

Top comments (8)

Collapse
 
practicingdev profile image
Practicing Developer • Edited

It's a big sheet of paper with a number on each line.

You can write anything you want on each line but are limited to whatever can fit in that fixed amount of space. You can also erase whatever is on the line and replace it with something else later if you want.

You can look stuff up later by number, making it so that you don't need to remember everything that was written on each line, just which line(s) to find it on.

You can make all sorts of neat things happen if you come up with special rules that tell you which lines to look at or change the contents of in which order, and can even place those instructions in memory so that they can make changes to the rules themselves.

From there, it gets pretty complicated. 😄

Collapse
 
angelarae63 profile image
Angela Whisnant

RAM (random access memory) is digital memory. Now measured in gigs and terabytes, it can load and retrieve data much faster than an HDD, which is mechanical. That’s why, on startup, computers load parts of the OS or any programs you specify into RAM for quick retrieval. Generally, when techs talk about computer memory, they mean RAM.

Collapse
 
zoejm profile image
zoe-j-m • Edited

It's like a row of coat pegs at school. Each coatpeg has a number, so you can be told to go to it easily.

You can hang only one thing on each coat peg, and it's really quick to go and get them, but there's only so many pegs, so you can run out.

A peg might be empty, or it might have a coat on it. If you want to put a coat on a peg, you can only do so if there's not a coat there already, or you take the old coat off first.

Computer memory is like that - lots and lots of numbered hooks, each possibly holding a single piece of information.

The hard disk is more like a big chest. It can store loads and loads of coats, but it's quite slow to get them, and you might have to lift out a number of coats to get to yours.

Collapse
 
henrikwirth profile image
Henrik Wirth

And a child could ask back:

  • So I can remember to eat an unlimited amount of Lollypops?
    • How do I keep track of already eaten Lollypops?
  • Why would I write something in a notebook, if I could just remember everything in my head?

👼

Collapse
 
murrayvarey profile image
MurrayVarey

You are holding a book. You can read that book at any time -- look at its pictures, take in its words. However, you can only hold a small number of books without dropping them -- making a mess, and getting told off.

To swap for a new book, you have to walk to the bookshelf. This takes time. The bookshelf can hold a lot more books ... but you have to find the one you want. This also takes time.

The book you're holding is in RAM -- quick access, limited space. The books on the bookshelf are on a Disk -- slow access, more space.

(... And that's about where the analogy falls down.)

Collapse
 
thedotnetweekly profile image
The DotNET Weekly

Shoe rack, you have limited space, you can put a number of shoe at a time. You can remove a shoe and keep that rack empty or new shoes in the future.

Collapse
 
sanidz profile image
sanidz

Programs are toys, memory are hands.
You can only play with things you hold in your hands.

Collapse
 
vjnvisakh profile image
Visakh Vijayan

A box to store apples.