SlideShare a Scribd company logo
1 of 14
Download to read offline
VIRTUAL MEMORY
Presented by: -
Aaina
CONTENTS
 virtual memory
 Needs of virtual memory
 Importance of virtual memory
 Advantage of virtual memory
 Disadvantage of virtual memory
 Address space & memory space
 Page replacement algorithms
 FIFO
 LRU
 OPT
VIRTUAL MEMORY
 Virtual memory is a common part of operating system on desktop
computers.
 The term virtual memory refers to something which appears to be present
but actually it is not.
 He virtual memory technique allows users to use more memory for a
program than the real memory of a computer.
Page frames
CPU
Logical
page + x
Mapper
Virtual
address
(1)
Not
present
(4)
Page
frames
(3) Page
frame + x
present
(5)
Secondary
storage
NEED OF VIRTUAL MEMORY
 Virtual memory is a imaginary memory which we are
assuming. If we have a material that exceed your
memory at that time we need to use the concept of
virtual memory.
 virtual memory is temporary memory which is used
along with the ram of the system.
IMPORTANCE OF VIRTUAL MEMORY
 When your computer runs out of physical memory it
writes what it needs to remember to the hard disc in a
swap file as virtual memory.
 If a computer running Windows requires more memory/
RAM then there is installed in the system to run a
program, etc, it uses a small section of the hard drive for
this purpose
ADVANTAGES OF VIRTUAL MEMORY
 Allows processes whose aggregate memory requirement
is greater than the amount of physical memory, as
infrequently used pages can reside on the disk.
 Virtual memory allows speed gain when only a particular
segment of the program is required for the execution of
the program.
 This concept is very helpful in implementing
multiprogramming environment.
DISADVANTAGES OF VIRTUAL MEMORY
 Applications run slower if the system is using virtual
memory.
 It Takes more time to switch between applications.
 Less hard drive space for your use.
 It reduces system stability.
ADDRESS SPACE AND MEMORY SPACE
 Virtual memory is the address used by the programmer
and the set of such addresses is called address space.
 An address in main memory is called a physical address.
 The set of such locations in main memory is called the
memory space.
 Thus the memory space consist of the actual main
memory locations directly addressable for processing.
PAGE FRAME AND HIT RATIO
 Page Frame: - The main memory is divided into fixed
sized portions called page frame.
 The size of page frame is same as the size of page
because pages have to reside in page frames.
 Hit Ratio: - The ratio of the total number of hit divided
by the total CPU access to memory (i.e. hits plus misses)
is called hit ratio.
 Hit ratio=total number of hits
total number of hits + total number of mis
PAGE REPLACEMENT ALGORITHMS
 In a computer operating system that uses paging for virtual memory
management, page replacement algorithm decide which memory
pages to page out. When a page of memory need to be allocated.
 Paging happens when a page fault occurs.
 When a program starts execution, one or more pages are
transferred into main memory.
 FIFO (first in first out)
 LRU (Least Recently used)
 OPT (Optimal)
FIFO
hit hit hit
 First in first out is very easy to implement
 The fifo algorithm select the page for replacement that has been in memory
the longest time
 The page to be removed is easily determined because its identification
number is at the top of the fifo stack.
 It has the disadvantage that under certain circumstances pages are removed
and loaded from memory to frequently.
p2* p2*
p3
P3*
P5
p2
P3
P5
P4*
P3
P2*
p4
P3
p2*
p4
p5*
P2
p4
p5*
P2
p4
p5
P2
P1*
P5
p3*
p1
p2*
P3
P1
p2*
p3
1 2 3 4 5 6 7 8 9 10 11 12
time
P2 p3 p2 p1 p5 p2 p4 p5 p3 p2 p5 p2
page
LRU
 The least recently used page replacement algorithm
keeps track page uses over a short period of time.
 The LRU algorithm can be implemented by associating a
counter with every page that is n main memory.
p2* p2*
p3
P3*
P5
p2
P3*
P5
P2
P3
P5*
P2
P3
P5
p4*
p2*
P5
P4
P2
p5*
p4
P2
P5
P1*
p2*
P5
P1
P2
p3*
P1
P2
p3*
1 2 3 4 5 6 7 8 9 10 11 12
time
P2 p3 p2 p1 p5 p2 p4 p5 p3 p2 p5 p2
page
hit hit hit hit hit
OPT
 The optimal policy selects that page for replacement for
which the time to the next reference is longest.
 This algorithm result is fewest number of page faults.
p2 p2
p3
P2
P3
P5
P2
P3
P5
P2
P3
P5
P4
P3
p5
P4
P3
P5
P4
P3
p5
P2
P3
P5
P2
P3
P5
P2
p3
P1
P2
p3
1 2 3 4 5 6 7 8 9 10 11 12
P2 p3 p2 p1 p5 p2 p4 p5 p3 p2 p5 p2
hit hit hit hit hit
time
page
hit
virtualmemory-111228090333-phpapp02 (1).pdf

More Related Content

Similar to virtualmemory-111228090333-phpapp02 (1).pdf

Chapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptChapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptMonirJihad1
 
virtual memory.ppt
virtual memory.pptvirtual memory.ppt
virtual memory.pptsuryansh85
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.pptPratikBose10
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual MemoryArchith777
 
virtual-memory-130126022841-phpapp01.pdf
virtual-memory-130126022841-phpapp01.pdfvirtual-memory-130126022841-phpapp01.pdf
virtual-memory-130126022841-phpapp01.pdfry54321288
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory pptRITULDE
 
Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentationRanjeet Kumar
 
Power Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.pptPower Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.pptRahulRaj395610
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memoryvampugani
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memoryghayour abbas
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt completeKalai Selvi
 

Similar to virtualmemory-111228090333-phpapp02 (1).pdf (20)

Chapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptChapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.ppt
 
virtual memory.ppt
virtual memory.pptvirtual memory.ppt
virtual memory.ppt
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
virtual-memory-130126022841-phpapp01.pdf
virtual-memory-130126022841-phpapp01.pdfvirtual-memory-130126022841-phpapp01.pdf
virtual-memory-130126022841-phpapp01.pdf
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentation
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Power Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.pptPower Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.ppt
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
virtual memory - Computer operating system
virtual memory - Computer operating systemvirtual memory - Computer operating system
virtual memory - Computer operating system
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Os
OsOs
Os
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
VIRTUAL 2.pptx
VIRTUAL  2.pptxVIRTUAL  2.pptx
VIRTUAL 2.pptx
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt complete
 

More from ArchanaPandiyan

cloudcomputingdistributedcomputing-171208050503 (1).pdf
cloudcomputingdistributedcomputing-171208050503 (1).pdfcloudcomputingdistributedcomputing-171208050503 (1).pdf
cloudcomputingdistributedcomputing-171208050503 (1).pdfArchanaPandiyan
 
IOT System Management with NETCONF-YANG.pptx
IOT System Management with NETCONF-YANG.pptxIOT System Management with NETCONF-YANG.pptx
IOT System Management with NETCONF-YANG.pptxArchanaPandiyan
 
Untitled presentation (5).pptx
Untitled presentation (5).pptxUntitled presentation (5).pptx
Untitled presentation (5).pptxArchanaPandiyan
 
Untitled presentation (5).pptx
Untitled presentation (5).pptxUntitled presentation (5).pptx
Untitled presentation (5).pptxArchanaPandiyan
 
Untitled presentation (3).pptx
Untitled presentation (3).pptxUntitled presentation (3).pptx
Untitled presentation (3).pptxArchanaPandiyan
 
Untitled presentation (2).pptx
Untitled presentation (2).pptxUntitled presentation (2).pptx
Untitled presentation (2).pptxArchanaPandiyan
 
Human Resource Management or Staffing.pptx
Human Resource Management or Staffing.pptxHuman Resource Management or Staffing.pptx
Human Resource Management or Staffing.pptxArchanaPandiyan
 

More from ArchanaPandiyan (7)

cloudcomputingdistributedcomputing-171208050503 (1).pdf
cloudcomputingdistributedcomputing-171208050503 (1).pdfcloudcomputingdistributedcomputing-171208050503 (1).pdf
cloudcomputingdistributedcomputing-171208050503 (1).pdf
 
IOT System Management with NETCONF-YANG.pptx
IOT System Management with NETCONF-YANG.pptxIOT System Management with NETCONF-YANG.pptx
IOT System Management with NETCONF-YANG.pptx
 
Untitled presentation (5).pptx
Untitled presentation (5).pptxUntitled presentation (5).pptx
Untitled presentation (5).pptx
 
Untitled presentation (5).pptx
Untitled presentation (5).pptxUntitled presentation (5).pptx
Untitled presentation (5).pptx
 
Untitled presentation (3).pptx
Untitled presentation (3).pptxUntitled presentation (3).pptx
Untitled presentation (3).pptx
 
Untitled presentation (2).pptx
Untitled presentation (2).pptxUntitled presentation (2).pptx
Untitled presentation (2).pptx
 
Human Resource Management or Staffing.pptx
Human Resource Management or Staffing.pptxHuman Resource Management or Staffing.pptx
Human Resource Management or Staffing.pptx
 

Recently uploaded

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 

virtualmemory-111228090333-phpapp02 (1).pdf

  • 2. CONTENTS  virtual memory  Needs of virtual memory  Importance of virtual memory  Advantage of virtual memory  Disadvantage of virtual memory  Address space & memory space  Page replacement algorithms  FIFO  LRU  OPT
  • 3. VIRTUAL MEMORY  Virtual memory is a common part of operating system on desktop computers.  The term virtual memory refers to something which appears to be present but actually it is not.  He virtual memory technique allows users to use more memory for a program than the real memory of a computer. Page frames CPU Logical page + x Mapper Virtual address (1) Not present (4) Page frames (3) Page frame + x present (5) Secondary storage
  • 4. NEED OF VIRTUAL MEMORY  Virtual memory is a imaginary memory which we are assuming. If we have a material that exceed your memory at that time we need to use the concept of virtual memory.  virtual memory is temporary memory which is used along with the ram of the system.
  • 5. IMPORTANCE OF VIRTUAL MEMORY  When your computer runs out of physical memory it writes what it needs to remember to the hard disc in a swap file as virtual memory.  If a computer running Windows requires more memory/ RAM then there is installed in the system to run a program, etc, it uses a small section of the hard drive for this purpose
  • 6. ADVANTAGES OF VIRTUAL MEMORY  Allows processes whose aggregate memory requirement is greater than the amount of physical memory, as infrequently used pages can reside on the disk.  Virtual memory allows speed gain when only a particular segment of the program is required for the execution of the program.  This concept is very helpful in implementing multiprogramming environment.
  • 7. DISADVANTAGES OF VIRTUAL MEMORY  Applications run slower if the system is using virtual memory.  It Takes more time to switch between applications.  Less hard drive space for your use.  It reduces system stability.
  • 8. ADDRESS SPACE AND MEMORY SPACE  Virtual memory is the address used by the programmer and the set of such addresses is called address space.  An address in main memory is called a physical address.  The set of such locations in main memory is called the memory space.  Thus the memory space consist of the actual main memory locations directly addressable for processing.
  • 9. PAGE FRAME AND HIT RATIO  Page Frame: - The main memory is divided into fixed sized portions called page frame.  The size of page frame is same as the size of page because pages have to reside in page frames.  Hit Ratio: - The ratio of the total number of hit divided by the total CPU access to memory (i.e. hits plus misses) is called hit ratio.  Hit ratio=total number of hits total number of hits + total number of mis
  • 10. PAGE REPLACEMENT ALGORITHMS  In a computer operating system that uses paging for virtual memory management, page replacement algorithm decide which memory pages to page out. When a page of memory need to be allocated.  Paging happens when a page fault occurs.  When a program starts execution, one or more pages are transferred into main memory.  FIFO (first in first out)  LRU (Least Recently used)  OPT (Optimal)
  • 11. FIFO hit hit hit  First in first out is very easy to implement  The fifo algorithm select the page for replacement that has been in memory the longest time  The page to be removed is easily determined because its identification number is at the top of the fifo stack.  It has the disadvantage that under certain circumstances pages are removed and loaded from memory to frequently. p2* p2* p3 P3* P5 p2 P3 P5 P4* P3 P2* p4 P3 p2* p4 p5* P2 p4 p5* P2 p4 p5 P2 P1* P5 p3* p1 p2* P3 P1 p2* p3 1 2 3 4 5 6 7 8 9 10 11 12 time P2 p3 p2 p1 p5 p2 p4 p5 p3 p2 p5 p2 page
  • 12. LRU  The least recently used page replacement algorithm keeps track page uses over a short period of time.  The LRU algorithm can be implemented by associating a counter with every page that is n main memory. p2* p2* p3 P3* P5 p2 P3* P5 P2 P3 P5* P2 P3 P5 p4* p2* P5 P4 P2 p5* p4 P2 P5 P1* p2* P5 P1 P2 p3* P1 P2 p3* 1 2 3 4 5 6 7 8 9 10 11 12 time P2 p3 p2 p1 p5 p2 p4 p5 p3 p2 p5 p2 page hit hit hit hit hit
  • 13. OPT  The optimal policy selects that page for replacement for which the time to the next reference is longest.  This algorithm result is fewest number of page faults. p2 p2 p3 P2 P3 P5 P2 P3 P5 P2 P3 P5 P4 P3 p5 P4 P3 P5 P4 P3 p5 P2 P3 P5 P2 P3 P5 P2 p3 P1 P2 p3 1 2 3 4 5 6 7 8 9 10 11 12 P2 p3 p2 p1 p5 p2 p4 p5 p3 p2 p5 p2 hit hit hit hit hit time page hit