SlideShare a Scribd company logo
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

PPT
NOV11 virtual memory.ppt
PPT
virtual memory.ppt
PPT
NOV11 virtual memory.ppt
PPT
Power Point Presentation on Virtual Memory.ppt
PPTX
coafinal1-copy-150430204758-conversion-gate01.pptx
PPTX
Abhaycavirtual memory and the pagehit.pptx
PPTX
Virtual Memory
PPTX
Computer architecture virtual memory
NOV11 virtual memory.ppt
virtual memory.ppt
NOV11 virtual memory.ppt
Power Point Presentation on Virtual Memory.ppt
coafinal1-copy-150430204758-conversion-gate01.pptx
Abhaycavirtual memory and the pagehit.pptx
Virtual Memory
Computer architecture virtual memory

Similar to Chapter 09 - Virtual Memory.ppt (20)

DOCX
virtual memory
PPT
Virtual memory
PPT
Memory Management-Muhammad Ahmad.ppt
PDF
Virtual memory
PPT
Virtual Memory
PPTX
Virtual Memory in Windows
PDF
The life and times
PPTX
Os unit 2
PDF
virtualmemory-111228090333-phpapp02 (1).pdf
PPT
Virtual memory ppts
PPT
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
PPT
Virtual memory
PPT
Virtual memory
PPT
Virtual memory
PPTX
Paging +Algorithem+Segmentation+memory management
PDF
CSI-503 - 9. Virtual Memory
PPT
memory management and Virtual Memory.ppt
PPT
Cache replacement policies,cache miss,writingtechniques
PPTX
Memory virtualization
PPT
Chapter 8 - Virtual memory - William stallings.ppt
virtual memory
Virtual memory
Memory Management-Muhammad Ahmad.ppt
Virtual memory
Virtual Memory
Virtual Memory in Windows
The life and times
Os unit 2
virtualmemory-111228090333-phpapp02 (1).pdf
Virtual memory ppts
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
Virtual memory
Virtual memory
Virtual memory
Paging +Algorithem+Segmentation+memory management
CSI-503 - 9. Virtual Memory
memory management and Virtual Memory.ppt
Cache replacement policies,cache miss,writingtechniques
Memory virtualization
Chapter 8 - Virtual memory - William stallings.ppt
Ad

Recently uploaded (20)

PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
UNIT 4 Total Quality Management .pptx
DOCX
573137875-Attendance-Management-System-original
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
web development for engineering and engineering
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
additive manufacturing of ss316l using mig welding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
PPT on Performance Review to get promotions
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPT
Mechanical Engineering MATERIALS Selection
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Embodied AI: Ushering in the Next Era of Intelligent Systems
UNIT 4 Total Quality Management .pptx
573137875-Attendance-Management-System-original
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Automation-in-Manufacturing-Chapter-Introduction.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
web development for engineering and engineering
Foundation to blockchain - A guide to Blockchain Tech
additive manufacturing of ss316l using mig welding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPT on Performance Review to get promotions
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Mechanical Engineering MATERIALS Selection
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CH1 Production IntroductoryConcepts.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Ad

Chapter 09 - Virtual Memory.ppt

  • 1. Memory register CPU cache Main Memory Secondary Storage Server (or INTERNET) • larger capacity • lower speed • lower cost
  • 2. 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.
  • 3. 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.
  • 4. 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.
  • 5. 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.
  • 6. 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.
  • 7. 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.
  • 8. 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.
  • 9. 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.
  • 10. 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.
  • 11. Virtual Memory (Paging) Page table Address Space Page table Address Space Physical Memory
  • 12. 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.
  • 13. 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.
  • 14. 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