14/04/2025
Virtual Memory
Why use of Virtual Memory
Memory Management find problem when processes are out of RAM (Main
Memory)
It can cause crash of the system
To execute a program, data is loaded into memory from HDD (or SSD)
whenever required.
Some programs do require more RAM than already available in system
To make work, system maps a Virtual Memory (working as extra RAM) in the
secondary storage device (HDD, SSD)
RAM is the physical memory,
While virtual memory is RAM + swap space on the hard disk or SSD.
1
14/04/2025
Without Virtual Memory
If a system wants to process 5 tasks and RAM have only 4 memory locations to
load the data
The last process is not able to load in the memory causing crash to system
With Virtual Memory
It makes the RAM larger that a system can handle any number of processes
A storage space in HDD will be allocated for RAM to store processes (Pages) if
the storage space in RAM is full.
2
14/04/2025
With Virtual Memory
Virtual Memory gives illusion that still memory is available
The oldest process in RAM will be moved to Virtual Memory, so that a new
process will be loaded in RAM
Virtual Memory (Paging)
A process stores in Virtual Memory is known as Page
A page is a fixed-length consecutive (or contiguous) block of data utilized in virtual
memory systems
To load a page in RAM from Virtual Memory is known as Swapping
a problem in a hard disk drive (HDD) caused by excessive swapping in and out
of data causing a high rate of head movements during virtual memory
operations this cause Disk Thrashing
A point can be reached when the execution of a process comes to a halt since
the system is so busy moving data in and out of memory rather than doing any
actual execution – this is known as the thrash point
Disk Thrashing can be reduced by installing more RAM (physical Memory) or
reducing number of processes to be start in a system
We can use SSD instead of HDD to reduce Disk Thrashing