Why do computers need RAM memory? And why some programs require lots of it while others require less?

253 views

Just curious about it, but can’t understand why is it like that.

In: 7

15 Answers

Anonymous 0 Comments

In general a computer has 3 types of parts: logic cores, storage, and the “bus” which handles moving data between the logic cores and the storage.

Computer storage can be sorted along 2 axies: Cost per bit and response speed.

A general rule is that as memory responds faster to requests for data, it gets more and more expensive.

Now, I am going to walk through an analogy of how the logic core in your CPU sees data in your system that should help with why the various levels of memory in computers exists:

You (as the logic core) are sitting at a table in a library. You have a book open in front of you, there are other books on your table and even more elsewhere in the library.

Now, the book you are holding is the data that the logic core is actively working on, the other books on the table are in a memory type called “registers” which are built into your CPU’s cores and can hold maybe a few kilobytes per core.

You might think that the rest of the library is RAM, but it’s actually something called “cache” which is built into your CPU and is pretty damn fast but maxes out on the order of megabytes.

Now what is RAM here? It’s another, larger library on another continent, which has to mail you any books you request via the post office.

The next question you might ask is “so, what about my hard drive or SSD?” well, that’s an even larger library on the moon, possibly even Mars if it’s a hard disk since that has even worse lag time; either way sending you a book is a laborious process that involves a spaceship and atmospheric-entry.

You can also get magnetic tape storage which in this analogy would be an absolutely massive library on Pluto.

The exact ratios between the timings here are off, but this is meant as an exaggeration to convey an idea.

As to why some programs need more than others, that’s fairly simple: different programs are designed to do different things, and different tasks take different resources to do. It’s kind of like trains, when you plan on having a train carry more cargo you add more cars to it so that there’s space for everything.

Fun fact: on moder motherboards the physical location of RAM is partially dictated by the speed of light because of the length of the copper traces between those chips and the CPU.

TL;DR: RAM in computers serves as a balance between capacity and speed so that computers can access the data they need as quickly as they need it, and programs need to be able to access various quantities of data to serve their functions which depends on what their designed to do.

You are viewing 1 out of 15 answers, click here to view all answers.