Physical memory, also known as primary storage or RAM (Random Access Memory), refers to the memory chips that are physically present in a computer system. These memory chips hold the data the computer is currently using or processing.
Physical memory is volatile, which means it loses its data when the power goes off. It usually consists of memory chips, either on the motherboard or on RAM modules that you can easily upgrade or replace. We call the amount of physical memory in a computer its memory capacity.
Physical memory is a finite resource, and the amount of memory that a computer system has will directly affect its performance. When the computer is running low on physical memory, it may start to use the hard drive as virtual memory, which can slow down the performance of the system. To ensure optimal performance, it is important to have enough physical memory for the tasks that the computer is performing.

Memory can also be classified into two broad categories :
- Volatile memory: Memory that requires power to retain data. Once the power goes off, this memory loses its data. RAM (Random Access Memory) is an example of volatile memory.
- Non-volatile memory: Memory that does not require power to retain data. Once you store data, it stays even when the power goes off. Examples of non-volatile memory include ROM (Read-Only Memory) and flash memory.
Memory hierarchy:
1. Cache Memory:
Cache memory is a small, high-speed memory that holds frequently accessed data. It sits on the CPU or close to it, and it speeds up data processing. Cache memory is faster than RAM, and it holds the most recently used data so that the CPU can reach it quickly.
2. Register Memory
A register is a small, high-speed memory that is located within the CPU. They hold the data the CPU is working on right now, and they are the fastest type of memory in a computer. Registers hold the data the CPU is currently processing, and they are much smaller than cache and RAM
3. Main memory or primary memory
The main memory unit that connects directly to the CPU is the primary memory.
- Random Access Memory: People also call RAM volatile memory. Generally, RAM temporarily stores input data, output data and intermediate results.
- Static RAM or SRAM
- Dynamic Ram or DRAM
- Read-only memory: ROM is not as accessible as RAM and is, therefore, non-volatile memory. Once the manufacturer programs a mask ROM chip, nobody can rewrite it. The only changes you can make in ROM is at the time of manufacturing.
- Programmable ROM or PROM
- Electrically Erasable Programmable ROM or EEPROM
- Erasable Programmable ROM or EPROM
4. Auxiliary memory or secondary memory
Auxiliary memory, also called secondary or external storage, is any memory that the CPU cannot access directly. It keeps data the computer isn’t using right now but needs to store long term.
- Magnetic Disk: A magnetic disk is a type of storage device that uses magnetic disks to store data. A magnetic coating covers these disks, and devices such as hard disk drives (HDD) and floppy disks use them. Magnetic disks can be both internal and external to a computer. They are non-volatile, which means they keep their data even when the power is off. People commonly use them for long-term storage and backup.
- Magnetic Tape: A magnetic tape is a type of storage device that uses magnetic tape to store data. A magnetic coating covers the tape, and tape drives read and write it. Organizations mainly use magnetic tape for backup and archiving, and it also keeps its data when the power is off. They have a higher storage capacity than magnetic disks and can store large amounts of data. However, they are slower in data access and retrieval and require more physical space than disk storage.
Examples of auxiliary memory include:
- Hard Disk Drive (HDD): A non-volatile storage device that uses magnetic disks to store data. An HDD holds far more than RAM, and it keeps its data even when the computer is off.
- Solid-State Drive (SSD): A non-volatile storage device that uses flash memory to store data. It is faster and more reliable than an HDD and it is becoming a popular alternative for long-term storage.
- USB drive: A USB drive is a small, portable storage device that you plug into a computer’s USB port. People often use it to store data and move it between computers.
- Optical storage devices (CD, DVD, Blu-ray): These are non-volatile storage devices that use laser technology to read and write data on a disk. People mainly use them for backup and archiving.
- Cloud storage: This is a type of remote storage that allows users to store data on a remote server and access it from anywhere with an internet connection.
Difference Between all of them:
| Level | 1 | 2 | 3 | 4 |
| Name | Register | Cache | Main Memory | Secondary Memory |
| Size | <1 KB | less than 16 MB | <16GB | >100 GB |
| Implementation | Multi-ports | On-chip/SRAM | DRAM (capacitor memory) | Magnetic |
| Access Time | 0.25ns to 0.5ns | 0.5 to 25ns | 80ns to 250ns | 50 lakh ns |
| Bandwidth | 20000 to 1 lakh MBytes | 5000 to 15000 | 1000 to 5000 | 20 to 150 |
| Managed by | Compiler | Hardware | Operating System | Operating System |
| Backing Mechanism | From cache | from Main Memory | from Secondary Memory | from CD |
Advantages :
- VM supports Swapping.
- Processes can share common data or code to save memory.
- The process need not be in memory as a whole.
- No need for complicated overlay techniques.
- The process may even be larger than all of the physical memory.
- The system reads data and code from the disk as needed.
- The OS can place code anywhere in physical memory without relocation.
- Main memory can hold more processes, which increases CPU utilization.
- Each program can have its own address space.
- No need for the compiler to generate addresses that are unique from addresses for other programs
- Don’t need to break the program into fragments to accommodate memory limitations
Disadvantages :
- Memory requirements.
- Longer memory access times.
Running Linux servers in production? Our Linux server hardening & security audit checks configuration, patching, SSH and logging. You can also use our free Linux server hardening checklist, or contact us.
