Main Types of Computer Memory
Tags: beginners, firstyearincode
Published: 2019-12-15 20:21:20

In this post I'll be talking about the main aspects of computer memory. Memory is used to store all of the data and instructions that our computers use. There are two types of computer memory, volatile and non-volatile. Volatile memory is memory that loses its contents when the computer or hardware device loses power. Your computer's random access memory, known as RAM, is an example of volatile memory. It is why if your computer freezes or reboots when working on a program, you lose anything that hasn't been saved. Non-volatile memory is memory that keeps its contents even if the power is lost. An example of non-volatile memory would be your hard drive.

When a program is opened, such as your Internet browser, it is loaded from your hard drive and placed into RAM. This process allows that program to communicate with the processor at higher speeds. Anything you save to your computer, such as a picture or video, is sent to your hard drive for storage.Although both the hard drive and RAM are memory, it's more appropriate to refer to RAM as "memory" or "primary memory" and a hard drive as "storage" or "secondary storage." The average amount of RAM in a modern computer ranges from about 4GB to 16GB, and about 500GB of hard disk drive storage.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/vhmmittsuqwc0mzgcv6q.jpg)

Non-volatile memory is much slower that volatile memory when it come to read and write times. Non-volatile memory does not require a connection to a power source to retain information, and can be thought of as your computers long term memory. Not only does it use less power, but it is also considerably cheaper than volatile memory. It is used to store essentially all of the information that is stored on your computer. Solid state drives, or SSDs, are much faster than normal hard drives since they don't have moving pieces needed to read and write to them, but their speed still doesn't compare to the speed RAM.

Volatile memory can be thought of as your computers short term memory. It holds all of the information that your computer thinks it might need immediately, like data that may be used when running software. It needs a constant supply of power, but since it generally has less moving parts than volatile memory, the things stored in RAM can be accessed almost immediately. The more RAM that your computer has, the better it will be at running larger applications or multi tasking.

There are two main types of volatile memory. Static, also known as SRAM, requires a constant flow of electricity to hold its information. There is never any refreshing needed to update its stored data. There is also dynamic volatile memory, known as DRAM. It requires pulses of electricity to update its stored information, and general accessing speeds are slower than SRAM. With the slower speed comes a lower price tag, and usually higher storage capacities.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/2d46fk9t629gttpih8s9.png)

Above we can see the differences between storage size and reading and writing speeds of SSD and RAM data. This graph was comparing DRAM and a SSD on a 2014 macBook air. On average RAM read speeds were 6.3 times faster that SSD, and write speeds for RAM were an average of 4.5 times faster. Both types of memory have their pros and cons, and both are essential for your computer to operate as efficiently as possible.