SlideShare a Scribd company logo
1 of 28
Damian Gordon
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
Computer
programs
are stored
here
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
Computer
programs
are stored
here
Until they
need to
be
executed
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
Computer
programs
are stored
here
Until they
need to
be
executedThen they
are moved
to here
 In modern operating systems, before a
program is loaded into main memory, it is
divided into chunks, called PAGES.
 In modern operating systems, before a
program is loaded into main memory, it is
divided into chunks, called PAGES.
Program 3
 In modern operating systems, before a
program is loaded into main memory, it is
divided into chunks, called PAGES.
Program 3
Page 2
Page 3
Page 4
Page 5
Page 6
Page 1
Page 7
 Each PAGE is loaded into memory locations
called PAGE FRAMES.
 Each PAGE is loaded into memory locations
called PAGE FRAMES.
200K
available
MAIN
MEMORY
 Each PAGE is loaded into memory locations
called PAGE FRAMES.
MAIN
MEMORY
Page Frame 1
Page Frame 2
Page Frame 3
Page Frame 4
Page Frame 5
Page Frame 6
Page Frame 7
Page Frame 8
Page Frame 9
Page Frame 10
200K
available
 If the PAGES are the exact
same size as the PAGE
FRAMES (and the same
size as the disk sectors),
this scheme works very
well. MAIN
MEMORY
Page Frame 1
Page Frame 2
Page Frame 3
Page Frame 4
Page Frame 5
Page Frame 6
Page Frame 7
Page Frame 8
Page Frame 9
Page Frame 10
200K
available
 The Memory Manager prepares a program for
execution by doing the following:
1. Determine the number of pages in the program
2. Locate enough empty page frames in main
memory
3. Load all the program’s pages into them
The empty page frame does not have to be
contagious.
 Consider a program that 350 bytes, and the
page size is 100 bytes.
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Program 4:
350 bytes
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Program 4:
350 bytes
Page 0
Program 4:
350 bytes
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Page 0
Page 1
Program 4:
350 bytes
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Page 0
Page 1
Page 2
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Page 3
Program 4:
350 bytes
Page 0
Page 1
Page 2
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Main
Memory
Page 3
Program 4:
350 bytes
Page 0
Page 1
Page 2
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Main
Memory
Operating
System
Page 3
Program 4:
350 bytes
Page 0
Page 1
Page 2
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Main
Memory
Operating
System
Page 2
Page 0
Page 1
Page 3
Page 3
Program 4:
350 bytes
Page 0
Page 1
Page 2
 Consider a program that 350 bytes, and the
page size is 100 bytes.
Main
Memory
Operating
System
Page 2
Page 0
Page 1
Page 3
A little bit of
internal
fragmentation
Page 3
Program 4:
350 bytes
Page 0
Page 1
Page 2
 A useful extension to the notion of PAGING is
DEMAND PAGING.
 Demand Paging introduces the notion that
you don’t have to load the whole program
into memory, just part of it.
 Because not all of the program needs to be in
memory at the same time.
 This means that lots of programs can be run
at the same time, and there is an illusion of a
significantly larger amount of memory than
with regular paging.
 To make this work, pages have to be moved
very quickly from Secondary Storage to Main
Memory and back again (this is called
“swapping”).
 This leads to the concept of VIRTUAL
MEMORY
 The size of main memory appears much
larger than the actual size, since many
programs can appear to be fully loaded into
main memory at the same time, when in
actual fact, only part of many programs are
loaded into main memory.

More Related Content

What's hot

Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
Piyush Rochwani
 
Windows memory management
Windows memory managementWindows memory management
Windows memory management
Tech_MX
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
myrajendra
 

What's hot (20)

Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Structure of the page table
Structure of the page tableStructure of the page table
Structure of the page table
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Synchronous vs Asynchronous Programming
Synchronous vs Asynchronous ProgrammingSynchronous vs Asynchronous Programming
Synchronous vs Asynchronous Programming
 
Memory management
Memory managementMemory management
Memory management
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Windows memory management
Windows memory managementWindows memory management
Windows memory management
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
Memory management
Memory managementMemory management
Memory management
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 

Viewers also liked (6)

Operating Systems: Linux in Detail
Operating Systems: Linux in DetailOperating Systems: Linux in Detail
Operating Systems: Linux in Detail
 
Operating Systems: File Management
Operating Systems: File ManagementOperating Systems: File Management
Operating Systems: File Management
 
Operating Systems: A History of MacOS
Operating Systems: A History of MacOSOperating Systems: A History of MacOS
Operating Systems: A History of MacOS
 
Operating Systems: Versions of Linux
Operating Systems: Versions of LinuxOperating Systems: Versions of Linux
Operating Systems: Versions of Linux
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
 
The Scrum Model
The Scrum ModelThe Scrum Model
The Scrum Model
 

Similar to Operating Systems: Virtual Memory

Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
rohassanie
 
How To Make System Work Faster
How To Make System Work FasterHow To Make System Work Faster
How To Make System Work Faster
Gaurav bhatnagar
 

Similar to Operating Systems: Virtual Memory (20)

Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual Memory
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Operating Systems: Memory Management
Operating Systems: Memory ManagementOperating Systems: Memory Management
Operating Systems: Memory Management
 
My First Hadoop Program !!!
My First Hadoop Program !!!My First Hadoop Program !!!
My First Hadoop Program !!!
 
Cloud Economics
Cloud EconomicsCloud Economics
Cloud Economics
 
DHFGHG
DHFGHGDHFGHG
DHFGHG
 
Virtual memory managment
Virtual memory managmentVirtual memory managment
Virtual memory managment
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Rdbms
Rdbms Rdbms
Rdbms
 
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...
 
Unit 5
Unit 5Unit 5
Unit 5
 
Nachos 2
Nachos 2Nachos 2
Nachos 2
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
 
Oracl DBA lab manual
Oracl DBA lab manualOracl DBA lab manual
Oracl DBA lab manual
 
Unit 1 - Computer memory.pptx
Unit 1 - Computer memory.pptxUnit 1 - Computer memory.pptx
Unit 1 - Computer memory.pptx
 
How To Make System Work Faster
How To Make System Work FasterHow To Make System Work Faster
How To Make System Work Faster
 
Fix Slow Running PC
Fix Slow Running PCFix Slow Running PC
Fix Slow Running PC
 
Google Glass Mirror API Setup
Google Glass Mirror API SetupGoogle Glass Mirror API Setup
Google Glass Mirror API Setup
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 

More from Damian T. Gordon

More from Damian T. Gordon (20)

Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
REST and RESTful Services
REST and RESTful ServicesREST and RESTful Services
REST and RESTful Services
 
Serverless Computing
Serverless ComputingServerless Computing
Serverless Computing
 
Cloud Identity Management
Cloud Identity ManagementCloud Identity Management
Cloud Identity Management
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 
Introduction to ChatGPT
Introduction to ChatGPTIntroduction to ChatGPT
Introduction to ChatGPT
 
How to Argue Logically
How to Argue LogicallyHow to Argue Logically
How to Argue Logically
 
Evaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONSEvaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONS
 
Evaluating Teaching: MERLOT
Evaluating Teaching: MERLOTEvaluating Teaching: MERLOT
Evaluating Teaching: MERLOT
 
Evaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson RubricEvaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson Rubric
 
Evaluating Teaching: LORI
Evaluating Teaching: LORIEvaluating Teaching: LORI
Evaluating Teaching: LORI
 
Designing Teaching: Pause Procedure
Designing Teaching: Pause ProcedureDesigning Teaching: Pause Procedure
Designing Teaching: Pause Procedure
 
Designing Teaching: ADDIE
Designing Teaching: ADDIEDesigning Teaching: ADDIE
Designing Teaching: ADDIE
 
Designing Teaching: ASSURE
Designing Teaching: ASSUREDesigning Teaching: ASSURE
Designing Teaching: ASSURE
 
Designing Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning TypesDesigning Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning Types
 
Designing Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of InstructionDesigning Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of Instruction
 
Designing Teaching: Elaboration Theory
Designing Teaching: Elaboration TheoryDesigning Teaching: Elaboration Theory
Designing Teaching: Elaboration Theory
 
Universally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some ConsiderationsUniversally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some Considerations
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
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
 

Operating Systems: Virtual Memory

  • 6. HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1 Computer programs are stored here Until they need to be executedThen they are moved to here
  • 7.  In modern operating systems, before a program is loaded into main memory, it is divided into chunks, called PAGES.
  • 8.  In modern operating systems, before a program is loaded into main memory, it is divided into chunks, called PAGES. Program 3
  • 9.  In modern operating systems, before a program is loaded into main memory, it is divided into chunks, called PAGES. Program 3 Page 2 Page 3 Page 4 Page 5 Page 6 Page 1 Page 7
  • 10.  Each PAGE is loaded into memory locations called PAGE FRAMES.
  • 11.  Each PAGE is loaded into memory locations called PAGE FRAMES. 200K available MAIN MEMORY
  • 12.  Each PAGE is loaded into memory locations called PAGE FRAMES. MAIN MEMORY Page Frame 1 Page Frame 2 Page Frame 3 Page Frame 4 Page Frame 5 Page Frame 6 Page Frame 7 Page Frame 8 Page Frame 9 Page Frame 10 200K available
  • 13.  If the PAGES are the exact same size as the PAGE FRAMES (and the same size as the disk sectors), this scheme works very well. MAIN MEMORY Page Frame 1 Page Frame 2 Page Frame 3 Page Frame 4 Page Frame 5 Page Frame 6 Page Frame 7 Page Frame 8 Page Frame 9 Page Frame 10 200K available
  • 14.  The Memory Manager prepares a program for execution by doing the following: 1. Determine the number of pages in the program 2. Locate enough empty page frames in main memory 3. Load all the program’s pages into them The empty page frame does not have to be contagious.
  • 15.  Consider a program that 350 bytes, and the page size is 100 bytes.
  • 16.  Consider a program that 350 bytes, and the page size is 100 bytes. Program 4: 350 bytes
  • 17.  Consider a program that 350 bytes, and the page size is 100 bytes. Program 4: 350 bytes Page 0
  • 18. Program 4: 350 bytes  Consider a program that 350 bytes, and the page size is 100 bytes. Page 0 Page 1
  • 19. Program 4: 350 bytes  Consider a program that 350 bytes, and the page size is 100 bytes. Page 0 Page 1 Page 2
  • 20.  Consider a program that 350 bytes, and the page size is 100 bytes. Page 3 Program 4: 350 bytes Page 0 Page 1 Page 2
  • 21.  Consider a program that 350 bytes, and the page size is 100 bytes. Main Memory Page 3 Program 4: 350 bytes Page 0 Page 1 Page 2
  • 22.  Consider a program that 350 bytes, and the page size is 100 bytes. Main Memory Operating System Page 3 Program 4: 350 bytes Page 0 Page 1 Page 2
  • 23.  Consider a program that 350 bytes, and the page size is 100 bytes. Main Memory Operating System Page 2 Page 0 Page 1 Page 3 Page 3 Program 4: 350 bytes Page 0 Page 1 Page 2
  • 24.  Consider a program that 350 bytes, and the page size is 100 bytes. Main Memory Operating System Page 2 Page 0 Page 1 Page 3 A little bit of internal fragmentation Page 3 Program 4: 350 bytes Page 0 Page 1 Page 2
  • 25.  A useful extension to the notion of PAGING is DEMAND PAGING.  Demand Paging introduces the notion that you don’t have to load the whole program into memory, just part of it.  Because not all of the program needs to be in memory at the same time.
  • 26.  This means that lots of programs can be run at the same time, and there is an illusion of a significantly larger amount of memory than with regular paging.
  • 27.  To make this work, pages have to be moved very quickly from Secondary Storage to Main Memory and back again (this is called “swapping”).
  • 28.  This leads to the concept of VIRTUAL MEMORY  The size of main memory appears much larger than the actual size, since many programs can appear to be fully loaded into main memory at the same time, when in actual fact, only part of many programs are loaded into main memory.