Primary Memory (main memory) includes RAM and cache, providing fast, temporary storage directly accessible by the CPU for active processes. It is volatile, meaning data is lost when power is off.
Secondary Memory includes hard drives, SSDs, and optical discs, offering larger, permanent storage for data and programs not in immediate use. It is non-volatile and has slower access speeds compared to primary memory.
Virtual Memory
Virtual memory expands a computer's usable memory by using both primary (RAM) and secondary storage. The operating system creates a virtual memory space divided into pages, loading only active pages into RAM while keeping less-used pages in secondary storage.
The Translation Lookaside Buffer (TLB) is a cache in the CPU's Memory Management Unit (MMU) that stores recently used virtual-to-physical address translations to speed up address conversion.
