Virtual Memory
Rahul Raman
Asst. Professor
Department of CSE
Indian Institute of information Technology
Design and Manufacturing, Kancheepuram, Chennai, India
Introduction
• Virtual memory permits the user to
construct programs as though a large
memory space were available.
• It gives the programmer an illusion that
they have a very large memory.
• It provides a mechanism for translating
program generated addresses into correct
main memory locations by means of
mapping table.
Introduction contd.,
• Virtual address – address used by a
programmer
• Address space - Set of virtual addresses
• Physical address – address in main
memory
• Memory space – set of physical
addresses.
Relation between address and memory
space in virtual memory system
In multi-program system,
programs and data are
transferred to and from auxiliary
memory and main memory
based on demands
imposed by the CPU.
Page replacement
• A virtual memory system is a combination of H/W and S/W
techniques.
• The memory management software system handles all the software
operations for the efficient utilization of memory space.
• It must decide
– Which page in main memory ought to be removed to make a new room
for a new page
– When a new page is to be transferred from auxiliary to main memory
– Where the place is to be placed in main memory
Page replacement
• Which page need to be replaced when
page fault occurs?
• Page Replacement Aglorithms
– FIFO (First-In First-Out)
– Optimal page replacement
– LRU (Least Recently Used)
FIFO
• When a page must be replaced, the oldest
page is chosen
Optimal Page-Replacement
Algorithm
References
• M. Morris Mano, “Computer system
Architecture”, third edition, Prentice Hall.
• 432012043520123