Computer vs human memory


Original blog illustration by Benedicte Rossi

Memory management is an essential skill that every programmer develops over time. To develop that skill you need to have a sense of how computer memory works. Surprisingly,  memory is not a simple thing. It is actually quite complex and only a few experts actually understand all of the details. In this post, I make an analogy between computer and human memory to explain the basics of both. This leads me to dive into the core of both computers and human minds as these are deeply intermingled.

As stated by wikipedia, memory refers to the physical devices used to store programs (sequences of instructions) or data. Both computers and humans have multiple forms of memory. I don’t know whether human memory inspired the design of computers but the similarities are striking as you are going to see.

  • RAM or Random Access Memory and the Hippocampus

When someone refers to computer memory, it usually means RAM. RAM or Random Access Memory was designed to provide a quick access to series of numbers. To limit access time, RAM is organized around arrays of electronic components that allow very quick access to any location in the memory. The main advantage of RAM is speed (typical RAM bandwidth today is around 5-10 GBytes/s). The constraints on speed have historically limited the overall size of available RAM on computers (today typical RAM memory is around 8 GBytes). The main disadvantage of this form of memory is its volatility : you turn off your computer and it is gone. 


Where is the hippocampus in our brain?

Humans do have a form of RAM and it is called short-term memory. Interestingly, short-term memory is usually associated with a very specific region of the brain called the hippocampus. Short-term memory is the memory you will use to recall immediate actions (like the series of words you are actually reading).


The hippocampus by Camillo Golgi

We don’t really understand how the hippocampus does it but I have always been puzzled by this structure homogeneity. It is composed of billions of cells that are very densely packed, like on an array as can be seen on the Golgi staining in the attached image. Reminds you something?

It is traditionally thought that the memory content stored in the hippocampus is transferred to another brain area for long term storage. This process is supposedly happening when you are turned off (your sleep). Again another similarity….

  • The hard drive and the cortex.
A hard drive

A hard drive from Western digital

As for the hippocampus, RAM storage was too volatile so engineers came out with a complimentary form of storage for long term memory in computers : the Hard Drive or HD. Hard drive have low bandwidth (usually 100 MBytes/s) but can store much more (computer usually comes with 500 GBytes of hard drive). This is where all of your data and programs is located.

Human long-term memory is presumably located in the cortex, exactly why and how is a matter of intense research nowadays. I am sure you have experienced that recollecting old memories can take quite some time (sometimes minutes). This process is usually variable as it is when reading from the hard drive. Hard drive can have very different read/write speed depending on where the memory is stored.


Long term memory is supposedly transferred to the cerebral cortex via the hippocampus.

As for humans, when you put a computer to sleep, RAM memory is transferred to the hard drive for long term storage. This process is reversed when you turn it on to make the best usage of the fast RAM. I suppose the same thing is happening when we wake up in the morning (in my case, this process is especially slow).

So far so good. Nothing too fancy here as the distinction between RAM and HD is usually known.

There are still 3 forms of computer memory that we need to understand, so hold on.

  • CPU Cache and neuronal network attractors
Transferring memory from the RAM to the CPU cache

Transferring memory from the RAM to the CPU cache

Computers have something called CPU cache. CPU or Central Processing Unit is probably the main thing a computer have that we don’t. This is the center of your system where all calculations are being done. In essence a CPU is just a ton of operators packed in a very tight space, they can combine bits of information in very specific ways. Thanks to decades of work, CPU operates at very very high frequencies, in the GHz range. Most CPUs are now 64 bits which means they can process 64 bits of information at each clock cycle. Because the frequency is so high, it became essential to have a high bandwidth to provide information to the CPU. If you check the numbers, it appears that the RAM is not fast enough to feed these monsters (the order of magnitude is 24 GBytes/s). That’s what the CACHE was designed for. The total memory content of the CACHE is very small as we really want this thing to be dead-fast (by small I mean in the MByte range). The CACHE is a very little memory space packed at the close proximity of your CPU to limit access times. There are multiple levels of cache (L1, L2 as depicted on the associated image but there are more) to provide intermediate levels of storage to make the CPU work smooth and organized.

Our brain is not clocked at such speeds. A typical neuron emits a new spike at about 10-40 Hz. While it can go higher, we can say we have a 40 Hz clock running in our skull. This is why our computer screens are only refreshed at 60 Hz. Why would you go faster, we don’t see it…

A neuronal network is a distributed cache memory

A neuronal network is a distributed cache memory

But as for more modern computer architecture, things are done in parallel in our little head. With such a low clock speed, information is transferred very slowly from one side of the head to the other so we can’t afford to have a single memory storage.

Indeed, Memory in the brain is distributed all other the place. I see the cortex as a gigantic CACHE storage. Each bit of information that is processed wake up the local neuronal network, reactivate its memory and compare this memory with the provided input. The beauty of neuronal networks is that both the program (what we usually script in Matlab in M-files) and the associated memory (the program parameters or your grandmother face) can be stored in the same place.

  • Protected memory and explicit memory

Human memory is further divided into two major classes called explicit and implicit memory. Explicit memory is the memory you are consciously using, like when you remember where you left your doors keys the day before, while implicit memory is not necessarily conscious : you know how to walk  but you don’t have to think to walk. Still you had to learn and store it somehow. I have no idea how this separation is done at the neuronal level but I do know that something very similar exists in computers and it’s called memory protection. Memory protection is built-in in any modern OS. When you write a program that needs some memory for its behavior, the OS allocates some space to it. It does so with some protection mechanism to prevent the program from accessing any other memory. This technique obviously prevent bugs and promote overall stability of your system. It does seem to me that explicit and implicit memory fullfill the same purpose : stability of our brain “Operating System” and protection of important memories. 

  • Memory swapping and writing

It sometimes happens that a program asks for more memory than what is available in the RAM. When this happen, your operating system has no other solution than to use what’s available : your hard drive. In that case, your OS will allocate some space on the hard drive for your program to work. This is usually refers as “swapping”. Since hard drive are several order of magnitude slower, this leads to great loss in performance. This is probably the number one reason things can go slow within Matlab. Your program will not be able to tell if its data is stored on the hard drive or in the RAM as this process is seemingly transparent. I personally believe that if your program start to swap, it is because your program was not designed properly. It is your job to be able to work within the memory limits of your computer. 

Swapping does not exactly exists for human mind as our mind was extremely well designed to work within its memory limits. However, in some ways we do swap all the time.

Indeed, what do you think you are doing when you take notes during a class?

The memory content of the class is too high for your brain to take it straight like this. You need an intermediate data storage device to allow you to assimilate the new data set. So you swap the data to a piece of paper using a pen. In some way, we human compensated our lack of a swapping device via writing…

This entry was posted in Beginners, Various. Bookmark the permalink.

19 Responses to Computer vs human memory

  1. Kenneth Udut says:

    Jerome, I just wanted to say: Your writing is *exactly* what I needed at this exactly point in time. My research in memory and the process of how exactly something becomes a recallable memory just this morning hit upon wanting to compare human memory to Caching, because it seems to me that the way Caches work and the way the human brain work are either similar – or at the very least, we can learn something from Caching.

    Not only did you help by writing out what I was working on – and NOW I can move on to the next step – You also posted it on my Birthday. Which is a little extra added niceness. –Ken

    • Jerome says:

      I am glad it is useful.

    • victorenesi says:

      Kenneth, you are here as well.. what are the odds!? 😀 We know our stuff.. Jerome, great write up, you are smart indeed, and any team with the hopes of hacking the mind (analogous with the computer) would be very lucky to have you.
      It’s my life’s dream, anyways, I deal more with perception than analysis – the philosophy of the mind (you could say). In other words, how information constitutes consciousness.
      Just as computing systems have sensors, we humans have natural sensors as well (taste buds, retina, sense of smell, etc). I know for one that these sensors make us ‘aware’, meaning that they are open to external and internal information (stimulus). Now, the mystery lies in how this information overload could formulate consciousness.
      Could conventional programming be the key, or do we need a new science in order to crack this existential feat?

  2. Rita says:

    I agree with Kenneth. I’m studying cognitive psychology right now and it helps immensely to compare the human brain with a computer.

    Although, I was wondering if the computer’s CPU is the human limbic system? Food for thought!

    Thanks for the blog!

    • Jerome says:

      Thank you for your kind comment.
      I will be very careful not to push all of this too far. My post is mainly a parallel description of both systems in the hope to help understand the computer memory system. I am trying to make comparisons only.

      More over, the limbic system incorporate a large number of brain areas, some of which seem to be involved with emotions (among other things). I think it is very far from being anything like a CPU.

  3. tseh says:

    wwwwwwwwwwwwooooooooooooooooww nice

  4. David says:

    Excellent post… As an academic neurosurgeon, I have was tasked to deliver a neuro-anatomy conference for the last 8 years, and have been using the computer analogy as well. Your analysis of memory processing is dead on!!! congrats.

  5. nvulane1 says:

    Great post, added some insight about the subject to my knowledge and helped me work on some paper. thanks

  6. Lee Grant Richardson II says:

    Okay, this Article is Very Helpful But I Want to Know What Part of the Brain Would Compare to a Computers Processor the Medulla-Oblongata ?

  7. Lee Grant Richardson II says:

    or Would the Medulla-Oblongata Compare to the Operating-System

    • Jerome says:

      As I wrote, I am not sure the analogy holds for CPUs. CPUs are centralized units of calculation. They are clocked at very high frequencies (GHz) to perform large amount of operations. Neuronal networks are not centralized and they don’t update that fast. By analogy, our brain updates rather at 40-100 Hz but any calculation is inherently distributed across the entire brain. I am not sure where to say would be the Brain OS (if there is any). I would expect this to be the actual wiring of neurons and probably some fundamental principles that regulate the communication between brain areas.

  8. Wenwu says:

    Nice job done! Extremely illustrative and clear.

  9. Amy says:

    Came here simply out of concern of my poor performance in certain tasks that require quick recall of small data sets, (like when adding 646 and 587 i forget the result of local calculations and have to note it somewhere or when I read a sentence filled with dates or other facts of no logical relevance it’s as if I skip the facts and replace with x and y).
    Although both computers and brains are very complex and have lots of new features to discover / develop), the analogy of swapping, ram and cache really hit me. It was almost all I needed (as I reader its all I need, but as a person with a terrible memory I would appreciate some solutions along the way 😀 ).
    Anyway, hope to read more about the topic soon. It was indeed a great comparison and enjoyable article.

  10. Nikoya says:

    Very helpful! This was the exact information I needed in order to work on my report! Thanks for breaking it down so easy and relatively.

  11. Rajesh Kumar says:

    Very nice difference

  12. Jouni "rautamiekka" Järvinen says:

    Human RAM has its limit too: if you start reading a book with massive varying content and your RAM runs out, you need to sleep so the brain can start processing the RAM contents. That’s what the feeling of head being full means. Except human hard drive has basically infinite space that may start at some gigabytes at birth but will easily reach the space we currently have name for, the yottabyte, by 100 years.

  13. Alexandria Phoenix says:

    Wow! I had no idea about this similarity between human memory and computer memory. Great article. Thank you so much Mr. Jerome for giving me an opportunity to read your great work.

  14. Benson says:

    I need more information

  15. hello guys, I’m Bakary Baldeh a Gambian by national, age of 22years. I am graduate from senior school and willingly taking computer(IT) as my profession. so I am kindly requesting a help from anyone capable of helping. in deed I am tremendously well verse with the little course I already did as I am writing, so I need more from other people who can kindly help online either on facebook or email… [email protected],,, or chat with me on facebook…. my user name…. Bakary Baldeh

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.