Virtual Memory in Operating System
Virtual Memory is a storage allocation
cation scheme in which secondary memory can be addressed as though it
were part of main memory. The addresses a program may use to reference memory are distinguished from the
addresses the memory system uses to identify physical storage sites, and program generated addresses are
translated automatically to the corresponding machine addresses.
It is a technique that is implemented using both hardware and software. It maps memory addresses used by a
program, called virtual addresses, into physical addresses iin computer memory.
Paging
Paging is the most common memory management technique:
virtual space of process divided into fixed
fixed-size pages
virtual address composed of page number and page offset
physical memory divided into fixed
fixed-size frames
page in virtual space fits into frame in physical memory
Paging-
Paging is a fixed size partitioning scheme.
In paging, secondary memory and main memory are divided into equal fixed size partitions.
The partitions of secondary memory are called as pages.
The partitions of main memory are called as frames.
Each process is divided into parts where size of each part is same as page size.
The size of the last part may be less than the page size.
The pages of process are stored in the frames of main memory depending upo
uponn their availability.
Example-
Consider a process is divided into 4 pages P 0, P1, P2 and P3.
Depending upon the availability, these pages may be stored in the main memory frames in a non-
non
contiguous fashion as shown-