SlideShare a Scribd company logo
1 of 21
Thrashing, Allocation of frames




                       http://raj-os.blogspot.in   1
HOME     PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS




         http://raj-os.blogspot.in   2
Recap


In the last class, you have learnt

•   Concepts of page replacement

•   LRU page replacement algorithm

•   Optimal page replacement algorithm


                  http://raj-os.blogspot.in   3
Objective

    On completion of this period, you would be

    able to know

•   Thrashing

•   Allocation of frames



                   http://raj-os.blogspot.in     4
Thrashing

• Swapping out a piece of a process just before
  that piece is needed
• The processor spends most of its time swapping
  pieces rather than executing user instructions
• This activity is called the thrashing




                     http://raj-os.blogspot.in     5
Thrashing
If a process does not have “enough” pages, the

    page-fault rate is very high. This leads to:

•     Low CPU utilization

•     Operating system thinks that it needs to

      increase the degree of multiprogramming

•     Another process added to the system


                     http://raj-os.blogspot.in     6
Thrashing

• A process is busy swapping pages in and out

• This high paging activity is called Thrashing

• More paging and less CPU utilization




                    http://raj-os.blogspot.in     7
Thrashing

  Disadvantages

• Increases the degree of multiprogramming

• System throughput decreases

• Page fault rate increases

• Effective access time increases

• This phenomenon is shown in next slide

                   http://raj-os.blogspot.in   8
Thrashing




http://raj-os.blogspot.in   9
Thrashing

• We can reduce the effect of thrashing by using
  the local replacement algorithm
• To prevent thrashing provide as many frames as
  it needs
• To know the number of frames use working set
  strategy



                   http://raj-os.blogspot.in       10
Thrashing

Why does paging work?

  Locality model

      Process migrates from one locality to another

      Localities may overlap

Why does thrashing occur?

  Σ size of locality > total memory size

                       http://raj-os.blogspot.in       11
Principle of Locality

• Program and data references within a process
  tend to cluster
• Only a few pieces of a process will be needed
  over a short period of time
• Possible to make intelligent guesses about
  which pieces will be needed in the future
• This suggests that virtual memory may work
  efficiently

                   http://raj-os.blogspot.in      12
Locality In A Memory-Reference Pattern




             http://raj-os.blogspot.in   13
Allocation of Frames

• Each process needs minimum number of

 pages

• Consider a single OS with 128K memory,
 with page size of 1K

• OS takes 35K, Leaving 93 frames for the user
   process

                http://raj-os.blogspot.in    14
Allocation of Frames

• The first 93 page faults would get free frames
  from the free frame list

• When the free frame list is exhausted a page
  replacement algorithm is used to allocate the
  frame



                    http://raj-os.blogspot.in      15
Allocation of Frames
Constraints
• Can not allocate more than the total no. of
  available frames
• Only a minimum no. of frames that can be
  allocated
• This no. is defined by the instruction set
  architecture
• As the no. of frames allocated decreases the
  page fault increases
• Slows down the process execution
                    http://raj-os.blogspot.in    16
Summary

  In this class, you have learnt
• Concept of Thrashing
  -High paging activity is called Thrashing

• Allocation of frames




                    http://raj-os.blogspot.in   17
Frequently Asked Questions


1. Explain the concept of thrashing ?

2. Write the disadvantages of thrashing ?

3. Explain the allocation of frames ?




                    http://raj-os.blogspot.in
                           9CM402.43            18
                                                18
Quiz
1. ___________Increases the degree of multiprogramming
    a) FIFO
    b) LRU
    c) Thrashing
   d) None

2. High paging activity is called __________
 a) FIFO
 b) LRU
 c) Thrashing
 d)None
                    http://raj-os.blogspot.in       19
Quiz
3. Each process needs ________number of pages
 a) Minimum
 b) LRU
 c) FIFO
 d) None
4. We can reduce the effect of thrashing by using the
 a) LRU
 b) Local replacement algorithm
 c) FIFO
 d) None
                      http://raj-os.blogspot.in         20
                                                        20
Other subject materials

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

home


                 http://raj-os.blogspot.in   21

More Related Content

What's hot

Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
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 Memorysgpraju
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentationhamza haseeb
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithmssathish sak
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 
Free space managment46
Free space managment46Free space managment46
Free space managment46myrajendra
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computingVajira Thambawita
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database SystemMeghaj Mallick
 
Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory managementSyaiful Ahdan
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structuresMukesh Chinta
 

What's hot (20)

Concurrency
ConcurrencyConcurrency
Concurrency
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Memory management
Memory managementMemory management
Memory management
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
 
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
 
Memory management
Memory managementMemory management
Memory management
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Free space managment46
Free space managment46Free space managment46
Free space managment46
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computing
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 
BANKER'S ALGORITHM
BANKER'S ALGORITHMBANKER'S ALGORITHM
BANKER'S ALGORITHM
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
 
Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 

Similar to Thrashing allocation frames.43

Set model and page fault.44
Set model and page fault.44Set model and page fault.44
Set model and page fault.44myrajendra
 
Lecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxLecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxAmanuelmergia
 
Internet of Things, TYBSC IT, Semester 5, Unit IV
Internet of Things, TYBSC IT, Semester 5, Unit IVInternet of Things, TYBSC IT, Semester 5, Unit IV
Internet of Things, TYBSC IT, Semester 5, Unit IVArti Parab Academics
 
Virtual memory and page replacement algorithm
Virtual memory and page replacement algorithmVirtual memory and page replacement algorithm
Virtual memory and page replacement algorithmMuhammad Mansoor Ul Haq
 
Virtual Memory Management Part - I.pdf
Virtual Memory Management Part - I.pdfVirtual Memory Management Part - I.pdf
Virtual Memory Management Part - I.pdfHarika Pudugosula
 
Virtual memory managment
Virtual memory managmentVirtual memory managment
Virtual memory managmentSantu Kumar
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in JavaRuben Badaró
 
#GeodeSummit - Off-Heap Storage Current and Future Design
#GeodeSummit - Off-Heap Storage Current and Future Design#GeodeSummit - Off-Heap Storage Current and Future Design
#GeodeSummit - Off-Heap Storage Current and Future DesignPivotalOpenSourceHub
 
Gopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowGopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowMateuszSzczyrzyca
 
Practical ,Transparent Operating System Support For Superpages
Practical ,Transparent Operating System Support For SuperpagesPractical ,Transparent Operating System Support For Superpages
Practical ,Transparent Operating System Support For SuperpagesNadeeshani Hewage
 
Operating system 38 page replacement
Operating system 38 page replacementOperating system 38 page replacement
Operating system 38 page replacementVaibhav Khanna
 
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 PotsdamFrom Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 PotsdamAndreas Grabner
 
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...George White
 
Virtual Memory Management Part - II.pdf
Virtual Memory Management Part - II.pdfVirtual Memory Management Part - II.pdf
Virtual Memory Management Part - II.pdfHarika Pudugosula
 
Comparision of page replacement algorithms.pptx
Comparision of page replacement algorithms.pptxComparision of page replacement algorithms.pptx
Comparision of page replacement algorithms.pptxSureshD94
 
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 Thrashing allocation frames.43 (20)

Set model and page fault.44
Set model and page fault.44Set model and page fault.44
Set model and page fault.44
 
Lecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxLecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptx
 
Virtual Memory.pdf
Virtual Memory.pdfVirtual Memory.pdf
Virtual Memory.pdf
 
Internet of Things, TYBSC IT, Semester 5, Unit IV
Internet of Things, TYBSC IT, Semester 5, Unit IVInternet of Things, TYBSC IT, Semester 5, Unit IV
Internet of Things, TYBSC IT, Semester 5, Unit IV
 
Virtual memory and page replacement algorithm
Virtual memory and page replacement algorithmVirtual memory and page replacement algorithm
Virtual memory and page replacement algorithm
 
Virtual Memory Management Part - I.pdf
Virtual Memory Management Part - I.pdfVirtual Memory Management Part - I.pdf
Virtual Memory Management Part - I.pdf
 
Virtual memory managment
Virtual memory managmentVirtual memory managment
Virtual memory managment
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in Java
 
#GeodeSummit - Off-Heap Storage Current and Future Design
#GeodeSummit - Off-Heap Storage Current and Future Design#GeodeSummit - Off-Heap Storage Current and Future Design
#GeodeSummit - Off-Heap Storage Current and Future Design
 
Gopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracowGopher in performance_tales_ms_go_cracow
Gopher in performance_tales_ms_go_cracow
 
Practical ,Transparent Operating System Support For Superpages
Practical ,Transparent Operating System Support For SuperpagesPractical ,Transparent Operating System Support For Superpages
Practical ,Transparent Operating System Support For Superpages
 
Apache Geode Offheap Storage
Apache Geode Offheap StorageApache Geode Offheap Storage
Apache Geode Offheap Storage
 
Operating system 38 page replacement
Operating system 38 page replacementOperating system 38 page replacement
Operating system 38 page replacement
 
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 PotsdamFrom Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
Imagine 2014: The Devil is in the Details How to Optimize Magento Hosting to ...
 
Virtual Memory Management Part - II.pdf
Virtual Memory Management Part - II.pdfVirtual Memory Management Part - II.pdf
Virtual Memory Management Part - II.pdf
 
Comparision of page replacement algorithms.pptx
Comparision of page replacement algorithms.pptxComparision of page replacement algorithms.pptx
Comparision of page replacement algorithms.pptx
 
Software + Babies
Software + BabiesSoftware + Babies
Software + Babies
 
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 myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Thrashing allocation frames.43

  • 1. Thrashing, Allocation of frames http://raj-os.blogspot.in 1
  • 2. HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS http://raj-os.blogspot.in 2
  • 3. Recap In the last class, you have learnt • Concepts of page replacement • LRU page replacement algorithm • Optimal page replacement algorithm http://raj-os.blogspot.in 3
  • 4. Objective On completion of this period, you would be able to know • Thrashing • Allocation of frames http://raj-os.blogspot.in 4
  • 5. Thrashing • Swapping out a piece of a process just before that piece is needed • The processor spends most of its time swapping pieces rather than executing user instructions • This activity is called the thrashing http://raj-os.blogspot.in 5
  • 6. Thrashing If a process does not have “enough” pages, the page-fault rate is very high. This leads to: • Low CPU utilization • Operating system thinks that it needs to increase the degree of multiprogramming • Another process added to the system http://raj-os.blogspot.in 6
  • 7. Thrashing • A process is busy swapping pages in and out • This high paging activity is called Thrashing • More paging and less CPU utilization http://raj-os.blogspot.in 7
  • 8. Thrashing Disadvantages • Increases the degree of multiprogramming • System throughput decreases • Page fault rate increases • Effective access time increases • This phenomenon is shown in next slide http://raj-os.blogspot.in 8
  • 10. Thrashing • We can reduce the effect of thrashing by using the local replacement algorithm • To prevent thrashing provide as many frames as it needs • To know the number of frames use working set strategy http://raj-os.blogspot.in 10
  • 11. Thrashing Why does paging work? Locality model  Process migrates from one locality to another  Localities may overlap Why does thrashing occur? Σ size of locality > total memory size http://raj-os.blogspot.in 11
  • 12. Principle of Locality • Program and data references within a process tend to cluster • Only a few pieces of a process will be needed over a short period of time • Possible to make intelligent guesses about which pieces will be needed in the future • This suggests that virtual memory may work efficiently http://raj-os.blogspot.in 12
  • 13. Locality In A Memory-Reference Pattern http://raj-os.blogspot.in 13
  • 14. Allocation of Frames • Each process needs minimum number of pages • Consider a single OS with 128K memory, with page size of 1K • OS takes 35K, Leaving 93 frames for the user process http://raj-os.blogspot.in 14
  • 15. Allocation of Frames • The first 93 page faults would get free frames from the free frame list • When the free frame list is exhausted a page replacement algorithm is used to allocate the frame http://raj-os.blogspot.in 15
  • 16. Allocation of Frames Constraints • Can not allocate more than the total no. of available frames • Only a minimum no. of frames that can be allocated • This no. is defined by the instruction set architecture • As the no. of frames allocated decreases the page fault increases • Slows down the process execution http://raj-os.blogspot.in 16
  • 17. Summary In this class, you have learnt • Concept of Thrashing -High paging activity is called Thrashing • Allocation of frames http://raj-os.blogspot.in 17
  • 18. Frequently Asked Questions 1. Explain the concept of thrashing ? 2. Write the disadvantages of thrashing ? 3. Explain the allocation of frames ? http://raj-os.blogspot.in 9CM402.43 18 18
  • 19. Quiz 1. ___________Increases the degree of multiprogramming a) FIFO b) LRU c) Thrashing d) None 2. High paging activity is called __________ a) FIFO b) LRU c) Thrashing d)None http://raj-os.blogspot.in 19
  • 20. Quiz 3. Each process needs ________number of pages a) Minimum b) LRU c) FIFO d) None 4. We can reduce the effect of thrashing by using the a) LRU b) Local replacement algorithm c) FIFO d) None http://raj-os.blogspot.in 20 20
  • 21. Other subject materials • Web designing • Micro processors • C++ tutorials • java home http://raj-os.blogspot.in 21