SlideShare a Scribd company logo
5
Most read
10
Most read
11
Most read
Storage Management

•   Demand Paging




                                    1
Recap

In the last class, you have learnt:

Virtual Memory

• Advantages of virtual memory




                                      2
HOME     PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS




                                  3
Objective


 On completion of this class you will be able to
 know
• Demand Paging




                                                   4
Demand Paging

• Demand paging system is similar to a paging
  system with swapping
• A lazy swapper swaps a page into memory only
  when it is needed
• A process is a sequence of pages rather than
  one large contiguous address space
• In demand paging instead of swapper the term
  pager is used
                                                 5
Demand Paging

• Bring a page into memory only when it is needed
  – Less I/O needed
  – Less memory needed
  – Faster response
  – More users


• Page is needed ⇒ reference to it
  – invalid reference ⇒ abort
  – not-in-memory ⇒ bring to memory
                                                6
Demand Paging
•When     a page is referenced, and that page isn’t in memory,
•   then get the page from disk and re-execute the statement
•Here’s    migration between memory and disk


          Program A



          Program B




                      Physical            Disk
                      Memory
                                 Fig 1
                                                                 7
Transfer of a Paged Memory to Contiguous
                Disk Space




                  Fig 2
                                       8
Valid-Invalid Bit
•   With each page table entry a valid–invalid bit is associated
    (1 ⇒ in-memory, 0 ⇒ not-in-memory)
•   Initially valid–invalid but is set to 0 on all entries
•   Example of a page table snapshot               Page table

•   During address translation, if valid–          Frame #      valid-invalid bit
                                                                1
    invalid bit in page table entry is                          1
    0 ⇒ page fault                                              1
                                                                1
                                                                0
                                                      

                                                                0
                                                                0
                                                      Fig 3
                                                                              9
Page Table When Some Pages Are Not in
            Main Memory




                 Fig 4
                                    10
Demand Paging
Steps in handling a page fault
•   The process has touched a page not currently in
    memory
•   Check an internal table for the target process to
    determine if the reference was valid ( do this in
    hardware )
•   If it was valid, but page isn't resident, then try to get it
    from secondary storage
•   Find a free frame; a page of physical memory not
    currently in use (May need to free up a page )

                                                              11
Demand Paging
• Schedule a disk operation to read the desired page into

  the newly allocated frame

• When memory is filled, modify the page table to show

  the page is now resident

• Restart the instruction that failed

• Do these steps using fig 5 which you can see on the next

  slide



                                                        12
Demand Paging




     Fig 5
                13
Frequently Asked Questions

• What is demand paging ?

• What is page fault ?




                                      14
Summary


 In this class, you have learnt

• Demand paging is used to get a page into

  memory only when it is needed




                                             15
Quiz
1. Demand paging system is similar to a paging
 system with
 a) Segmentation
 b) Swapping
 c) None

2. In demand paging instead of swapper the term
 __________is used
 a) Page offset
 b) Hole
 c) Pager
 d) None
                                                  16
Other subject materials

•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home

More Related Content

PPTX
Page replacement algorithms
PPTX
Virtual memory management in Operating System
PPTX
Operating system paging and segmentation
PDF
9 virtual memory management
PPT
Memory management
PPT
Thrashing allocation frames.43
PDF
Process scheduling (CPU Scheduling)
PPTX
Demand paging
Page replacement algorithms
Virtual memory management in Operating System
Operating system paging and segmentation
9 virtual memory management
Memory management
Thrashing allocation frames.43
Process scheduling (CPU Scheduling)
Demand paging

What's hot (20)

PPTX
Cache memory
PPT
Chapter 9 - Virtual Memory
PDF
Operating Systems - memory management
PPTX
Computer architecture virtual memory
PPTX
Cache memory ppt
PDF
Virtual memory
PPTX
contiguous memory allocation.pptx
PPTX
Cache Memory
PPTX
Operating system memory management
PDF
Cache replacement policies,cache miss,writingtechniques
PPT
Chapter 12 - Mass Storage Systems
PPTX
Demand paging
PPTX
Computer architecture page replacement algorithms
PPTX
Memory management ppt
PDF
Memory management
PPT
Page Replacement
PPT
Contiguous Memory Allocation.ppt
PPTX
Segmentation in operating systems
PPTX
File system structure
Cache memory
Chapter 9 - Virtual Memory
Operating Systems - memory management
Computer architecture virtual memory
Cache memory ppt
Virtual memory
contiguous memory allocation.pptx
Cache Memory
Operating system memory management
Cache replacement policies,cache miss,writingtechniques
Chapter 12 - Mass Storage Systems
Demand paging
Computer architecture page replacement algorithms
Memory management ppt
Memory management
Page Replacement
Contiguous Memory Allocation.ppt
Segmentation in operating systems
File system structure
Ad

Similar to 40 demand paging (20)

PPT
41 page replacement fifo
PPTX
Operating system 37 demand paging
PDF
Virtual Memory Management Part - I.pdf
PPTX
operating system virtual memory and logical memory
PPTX
3_page_replacement_algorithms computer system and architecture
PPT
PDF
Virtual Memory.pdf
PPTX
Lecture 8- Virtual Memory Final.pptx
PPT
36 fragmentaio nnd pageconcepts
PDF
Practical ,Transparent Operating System Support For Superpages
PDF
Virtual Memory Management Part - II.pdf
PPTX
Enabling the Duo-phase Data Management to Realize Longevity Bit-alterable Fla...
PPTX
Virtual Memory Management
PPT
page replacement algorithm powerpoint presentation
PDF
The life and times
PPT
Operating System
PPT
Virtual memory Chapter 9 simple and easy
PPT
Segmentation and paging
PDF
CSN221_Lec_34 Computer Architecture and Microprocessor
PPTX
CHAPTER 2 - Operating systems Virtual Memory.pptx
41 page replacement fifo
Operating system 37 demand paging
Virtual Memory Management Part - I.pdf
operating system virtual memory and logical memory
3_page_replacement_algorithms computer system and architecture
Virtual Memory.pdf
Lecture 8- Virtual Memory Final.pptx
36 fragmentaio nnd pageconcepts
Practical ,Transparent Operating System Support For Superpages
Virtual Memory Management Part - II.pdf
Enabling the Duo-phase Data Management to Realize Longevity Bit-alterable Fla...
Virtual Memory Management
page replacement algorithm powerpoint presentation
The life and times
Operating System
Virtual memory Chapter 9 simple and easy
Segmentation and paging
CSN221_Lec_34 Computer Architecture and Microprocessor
CHAPTER 2 - Operating systems Virtual Memory.pptx
Ad

More from myrajendra (20)

PPT
Fundamentals
PPT
Data type
PPTX
Hibernate example1
PPTX
Jdbc workflow
PPTX
2 jdbc drivers
PPTX
3 jdbc api
PPTX
4 jdbc step1
PPTX
Dao example
PPTX
Sessionex1
PPTX
Internal
PPTX
3. elements
PPTX
2. attributes
PPTX
1 introduction to html
PPTX
Headings
PPTX
Forms
PPT
PPTX
Views
PPTX
Views
PPTX
Views
PPT
Starting jdbc
Fundamentals
Data type
Hibernate example1
Jdbc workflow
2 jdbc drivers
3 jdbc api
4 jdbc step1
Dao example
Sessionex1
Internal
3. elements
2. attributes
1 introduction to html
Headings
Forms
Views
Views
Views
Starting jdbc

40 demand paging

  • 1. Storage Management • Demand Paging 1
  • 2. Recap In the last class, you have learnt: Virtual Memory • Advantages of virtual memory 2
  • 3. HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS 3
  • 4. Objective On completion of this class you will be able to know • Demand Paging 4
  • 5. Demand Paging • Demand paging system is similar to a paging system with swapping • A lazy swapper swaps a page into memory only when it is needed • A process is a sequence of pages rather than one large contiguous address space • In demand paging instead of swapper the term pager is used 5
  • 6. Demand Paging • Bring a page into memory only when it is needed – Less I/O needed – Less memory needed – Faster response – More users • Page is needed ⇒ reference to it – invalid reference ⇒ abort – not-in-memory ⇒ bring to memory 6
  • 7. Demand Paging •When a page is referenced, and that page isn’t in memory, • then get the page from disk and re-execute the statement •Here’s migration between memory and disk Program A Program B Physical Disk Memory Fig 1 7
  • 8. Transfer of a Paged Memory to Contiguous Disk Space Fig 2 8
  • 9. Valid-Invalid Bit • With each page table entry a valid–invalid bit is associated (1 ⇒ in-memory, 0 ⇒ not-in-memory) • Initially valid–invalid but is set to 0 on all entries • Example of a page table snapshot Page table • During address translation, if valid– Frame # valid-invalid bit 1 invalid bit in page table entry is 1 0 ⇒ page fault 1 1 0  0 0 Fig 3 9
  • 10. Page Table When Some Pages Are Not in Main Memory Fig 4 10
  • 11. Demand Paging Steps in handling a page fault • The process has touched a page not currently in memory • Check an internal table for the target process to determine if the reference was valid ( do this in hardware ) • If it was valid, but page isn't resident, then try to get it from secondary storage • Find a free frame; a page of physical memory not currently in use (May need to free up a page ) 11
  • 12. Demand Paging • Schedule a disk operation to read the desired page into the newly allocated frame • When memory is filled, modify the page table to show the page is now resident • Restart the instruction that failed • Do these steps using fig 5 which you can see on the next slide 12
  • 13. Demand Paging Fig 5 13
  • 14. Frequently Asked Questions • What is demand paging ? • What is page fault ? 14
  • 15. Summary In this class, you have learnt • Demand paging is used to get a page into memory only when it is needed 15
  • 16. Quiz 1. Demand paging system is similar to a paging system with a) Segmentation b) Swapping c) None 2. In demand paging instead of swapper the term __________is used a) Page offset b) Hole c) Pager d) None 16
  • 17. Other subject materials • Web designing • Micro processors • C++ tutorials • java home