SlideShare a Scribd company logo
1 of 15
Virtual Memory
Memory
register
CPU cache
Main Memory
Secondary Storage
Server (or INTERNET)
• larger capacity
• lower speed
• lower cost
What is…
 Virtual memory as an alternate set of
memory addresses.
 Programs use these virtual addresses
rather than real addresses to store
instructions and data.
 When the program is actually executed,
the virtual addresses are converted into
real memory addresses.
History
 virtual memory was developed in
approximately 1959 – 1962, at the University
of Manchester for the Atlas Computer,
completed in 1962.
 In 1961, Burroughs released the B5000, the
first commercial computer with virtual memory.
Why is it needed….
 Before the development of the virtual memory
technique, programmers in the 1940s and
1950s had to manage directly two-level
storage such as main memory or ram and
secondary memory in the form of hard disks
or earlier, magnetic drums.
 Enlarge the address space, the set of
addresses a program can utilize.
 Virtual memory might contain twice as many
addresses as main memory.
Object…
 When a computer is executing many
programs at the same time, Virtual memory
make the computer to share memory
efficiently.
 Eliminate a restriction that a computer works
in memory which is small and be limited.
 When many programs is running at the same
time, by distributing each suitable memory
area to each program, VM protect programs
to interfere each other in each memory area.
How does it work…
 To facilitate copying virtual memory into real
memory, the operating system divides virtual
memory into pages, each of which contains a
fixed number of addresses.
 Each page is stored on a disk until it is
needed.
 When the page is needed, the operating
system copies it from disk to main memory,
translating the virtual addresses into real
addresses.
MMU (Memory Management Unit)
 The hardware base that makes a virtual memory
system possible.
 Allows software to reference physical memory by
virtual addresses, quite often more than one.
 It accomplishes this through the use of page and
page tables.
 Use a section of memory to translate virtual
addresses into physical addresses via a series of
table lookups.
 The software that handles the page fault is generally
part of an operating system and the hardware that
detects this situation.
Segmentation……
 Segmentation involves the relocation of variable sized
segments into the physical address space.
 Generally these segments are contiguous units, and
are referred to in programs by their segment number
and an offset to the requested data.
 Efficient segmentation relies on programs that are
very thoughtfully written for their target system.
 Since segmentation relies on memory that is located
in single large blocks, it is very possible that enough
free space is available to load a new module, but can
not be utilized.
 Segmentation may also suffer from internal
fragmentation if segments are not variable-sized,
where memory above the segment is not used by the
program but is still “reserved” for it.
Paging……
 Paging provides a somewhat easier interface for
programs, in that its operation tends to be more
automatic and thus transparent.
 Each unit of transfer, referred to as a page, is of a
fixed size and swapped by the virtual memory
manager outside of the program’s control.
 Instead of utilizing a segment/offset addressing
approach, as seen in segmentation, paging uses a
linear sequence of virtual addresses which are
mapped to physical memory as necessary.
 Due to this addressing approach, a single program
may refer to series of many non-contiguous
segments.
 Although some internal fragmentation may still exist
due to the fixed size of the pages, the approach
virtually eliminates external fragmentation.
Paging……(cont’d)
 A technique used by virtual memory operating
systems to help ensure that the data you
need is available as quickly as possible.
 The operating system copies a certain
number of pages from your storage device to
main memory.
 When a program needs a page that is not in
maim memory, the operating system copies
the required page into memory and copies
another page back to the disk.
Virtual Memory (Paging)
Page table
Address Space
Page table
Address Space
Physical
Memory
Page fault
 An interrupt to the software raised by the
hardware when a program accesses a page
that is not mapped in physical memory.
 when a program accesses a memory location
in its memory and the page corresponding to
that memory is not loaded
 when a program accesses a memory location
in its memory and the program does not have
privileges to access the page corresponding
to that memory.
Paging replacement algorithms
 OPT(MIN) : eliminate the page that be not
expected to be used.
 FIFO(first input/first output) : rather than
choosing the victim page at random, the
oldest page is the first to be removed.
 LRU(Least Recently used) : move out the
page that is the least rarely used.
 LFU(Least Frequently used) : move out the
page that is not used often in the past.
Summary…
 Virtual memory is a common part of most operating
systems on computers.
 It has become so common because it provides a big
benefit for users at a very low cost.
 benefits of executing a program that is only partially
in memory.
 program is no longer constrained by the amount of
physical memory.
⇒ user would be able to write programs for an
extremely large virtual address space.
 more programs could be run at the same time
⇒ increase CPU utilization and throughput.
 less I/O would be needed to load or swap each user
program
⇒ run faster

More Related Content

Similar to NOV11 virtual memory.ppt

Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...ITM University
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memoryghayour abbas
 
An Efficient Virtual Memory using Graceful Code
An Efficient Virtual Memory using Graceful CodeAn Efficient Virtual Memory using Graceful Code
An Efficient Virtual Memory using Graceful Codeijtsrd
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1rohassanie
 
Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentationRanjeet Kumar
 
virtualmemory-111228090333-phpapp02 (1).pdf
virtualmemory-111228090333-phpapp02 (1).pdfvirtualmemory-111228090333-phpapp02 (1).pdf
virtualmemory-111228090333-phpapp02 (1).pdfArchanaPandiyan
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management Shashank Asthana
 
How many total bits are required for a direct-mapped cache with 2048 .pdf
How many total bits are required for a direct-mapped cache with 2048 .pdfHow many total bits are required for a direct-mapped cache with 2048 .pdf
How many total bits are required for a direct-mapped cache with 2048 .pdfEye2eyeopticians10
 
Presentation on Virtual Memory concepts in computer
Presentation on Virtual Memory concepts in computer Presentation on Virtual Memory concepts in computer
Presentation on Virtual Memory concepts in computer Oshin Kandpal
 
OS Presentation 2023.pptx
OS Presentation 2023.pptxOS Presentation 2023.pptx
OS Presentation 2023.pptxShayanAli68
 

Similar to NOV11 virtual memory.ppt (20)

Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
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
 
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
 
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
 
VirutualMemory.docx
VirutualMemory.docxVirutualMemory.docx
VirutualMemory.docx
 
An Efficient Virtual Memory using Graceful Code
An Efficient Virtual Memory using Graceful CodeAn Efficient Virtual Memory using Graceful Code
An Efficient Virtual Memory using Graceful Code
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
 
Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentation
 
virtualmemory-111228090333-phpapp02 (1).pdf
virtualmemory-111228090333-phpapp02 (1).pdfvirtualmemory-111228090333-phpapp02 (1).pdf
virtualmemory-111228090333-phpapp02 (1).pdf
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
Android Memory Management
Android Memory ManagementAndroid Memory Management
Android Memory Management
 
ppt
pptppt
ppt
 
Memory virtualization
Memory virtualizationMemory virtualization
Memory virtualization
 
How many total bits are required for a direct-mapped cache with 2048 .pdf
How many total bits are required for a direct-mapped cache with 2048 .pdfHow many total bits are required for a direct-mapped cache with 2048 .pdf
How many total bits are required for a direct-mapped cache with 2048 .pdf
 
Presentation on Virtual Memory concepts in computer
Presentation on Virtual Memory concepts in computer Presentation on Virtual Memory concepts in computer
Presentation on Virtual Memory concepts in computer
 
OS Presentation 2023.pptx
OS Presentation 2023.pptxOS Presentation 2023.pptx
OS Presentation 2023.pptx
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 

More from AshokRachapalli1

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptxAshokRachapalli1
 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...AshokRachapalli1
 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptxAshokRachapalli1
 
inputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxinputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxAshokRachapalli1
 
arithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxarithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxAshokRachapalli1
 
Computer Network Architecture.pptx
Computer Network Architecture.pptxComputer Network Architecture.pptx
Computer Network Architecture.pptxAshokRachapalli1
 
Computer Network Types.pptx
Computer Network Types.pptxComputer Network Types.pptx
Computer Network Types.pptxAshokRachapalli1
 
dataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxdataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxAshokRachapalli1
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptxAshokRachapalli1
 

More from AshokRachapalli1 (20)

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...
 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx
 
Chapter5 (1).ppt
Chapter5 (1).pptChapter5 (1).ppt
Chapter5 (1).ppt
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Addressing Modes.pptx
Addressing Modes.pptxAddressing Modes.pptx
Addressing Modes.pptx
 
inputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxinputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptx
 
lec16-memory.ppt
lec16-memory.pptlec16-memory.ppt
lec16-memory.ppt
 
lecture-17.ppt
lecture-17.pptlecture-17.ppt
lecture-17.ppt
 
arithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxarithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptx
 
instruction format.pptx
instruction format.pptxinstruction format.pptx
instruction format.pptx
 
Computer Network Architecture.pptx
Computer Network Architecture.pptxComputer Network Architecture.pptx
Computer Network Architecture.pptx
 
Computer Network Types.pptx
Computer Network Types.pptxComputer Network Types.pptx
Computer Network Types.pptx
 
dataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxdataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptx
 
Flow Control.pptx
Flow Control.pptxFlow Control.pptx
Flow Control.pptx
 
Chapter4.ppt
Chapter4.pptChapter4.ppt
Chapter4.ppt
 
intro22.ppt
intro22.pptintro22.ppt
intro22.ppt
 
osi.ppt
osi.pptosi.ppt
osi.ppt
 
switching.pptx
switching.pptxswitching.pptx
switching.pptx
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptx
 

Recently uploaded

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

NOV11 virtual memory.ppt

  • 2. Memory register CPU cache Main Memory Secondary Storage Server (or INTERNET) • larger capacity • lower speed • lower cost
  • 3. What is…  Virtual memory as an alternate set of memory addresses.  Programs use these virtual addresses rather than real addresses to store instructions and data.  When the program is actually executed, the virtual addresses are converted into real memory addresses.
  • 4. History  virtual memory was developed in approximately 1959 – 1962, at the University of Manchester for the Atlas Computer, completed in 1962.  In 1961, Burroughs released the B5000, the first commercial computer with virtual memory.
  • 5. Why is it needed….  Before the development of the virtual memory technique, programmers in the 1940s and 1950s had to manage directly two-level storage such as main memory or ram and secondary memory in the form of hard disks or earlier, magnetic drums.  Enlarge the address space, the set of addresses a program can utilize.  Virtual memory might contain twice as many addresses as main memory.
  • 6. Object…  When a computer is executing many programs at the same time, Virtual memory make the computer to share memory efficiently.  Eliminate a restriction that a computer works in memory which is small and be limited.  When many programs is running at the same time, by distributing each suitable memory area to each program, VM protect programs to interfere each other in each memory area.
  • 7. How does it work…  To facilitate copying virtual memory into real memory, the operating system divides virtual memory into pages, each of which contains a fixed number of addresses.  Each page is stored on a disk until it is needed.  When the page is needed, the operating system copies it from disk to main memory, translating the virtual addresses into real addresses.
  • 8. MMU (Memory Management Unit)  The hardware base that makes a virtual memory system possible.  Allows software to reference physical memory by virtual addresses, quite often more than one.  It accomplishes this through the use of page and page tables.  Use a section of memory to translate virtual addresses into physical addresses via a series of table lookups.  The software that handles the page fault is generally part of an operating system and the hardware that detects this situation.
  • 9. Segmentation……  Segmentation involves the relocation of variable sized segments into the physical address space.  Generally these segments are contiguous units, and are referred to in programs by their segment number and an offset to the requested data.  Efficient segmentation relies on programs that are very thoughtfully written for their target system.  Since segmentation relies on memory that is located in single large blocks, it is very possible that enough free space is available to load a new module, but can not be utilized.  Segmentation may also suffer from internal fragmentation if segments are not variable-sized, where memory above the segment is not used by the program but is still “reserved” for it.
  • 10. Paging……  Paging provides a somewhat easier interface for programs, in that its operation tends to be more automatic and thus transparent.  Each unit of transfer, referred to as a page, is of a fixed size and swapped by the virtual memory manager outside of the program’s control.  Instead of utilizing a segment/offset addressing approach, as seen in segmentation, paging uses a linear sequence of virtual addresses which are mapped to physical memory as necessary.  Due to this addressing approach, a single program may refer to series of many non-contiguous segments.  Although some internal fragmentation may still exist due to the fixed size of the pages, the approach virtually eliminates external fragmentation.
  • 11. Paging……(cont’d)  A technique used by virtual memory operating systems to help ensure that the data you need is available as quickly as possible.  The operating system copies a certain number of pages from your storage device to main memory.  When a program needs a page that is not in maim memory, the operating system copies the required page into memory and copies another page back to the disk.
  • 12. Virtual Memory (Paging) Page table Address Space Page table Address Space Physical Memory
  • 13. Page fault  An interrupt to the software raised by the hardware when a program accesses a page that is not mapped in physical memory.  when a program accesses a memory location in its memory and the page corresponding to that memory is not loaded  when a program accesses a memory location in its memory and the program does not have privileges to access the page corresponding to that memory.
  • 14. Paging replacement algorithms  OPT(MIN) : eliminate the page that be not expected to be used.  FIFO(first input/first output) : rather than choosing the victim page at random, the oldest page is the first to be removed.  LRU(Least Recently used) : move out the page that is the least rarely used.  LFU(Least Frequently used) : move out the page that is not used often in the past.
  • 15. Summary…  Virtual memory is a common part of most operating systems on computers.  It has become so common because it provides a big benefit for users at a very low cost.  benefits of executing a program that is only partially in memory.  program is no longer constrained by the amount of physical memory. ⇒ user would be able to write programs for an extremely large virtual address space.  more programs could be run at the same time ⇒ increase CPU utilization and throughput.  less I/O would be needed to load or swap each user program ⇒ run faster