L-5.16: What is Thrashing | Operating System

L-5.16: What is Thrashing | Operating System

Thrashing in Operating Systems

Understanding Thrashing

  • Thrashing is a critical concept in operating systems, directly related to the degree of multi-programming, which refers to the number of processes present in RAM.
  • The size of RAM is limited; bringing too many processes into RAM can lead to performance issues.

Impact on CPU Utilization

  • When processes require input-output operations, they enter a blocked state, causing the CPU to become idle and reducing throughput.
  • To maximize CPU utilization, more processes must be brought into RAM despite its limitations. This leads to the use of paging.

Paging Mechanism

  • In paging, processes are divided into pages that can be loaded into RAM. For example, 100 processes can be split into pages for efficient management.
  • By loading only one page from each process into RAM, multiple processes appear active even if not fully loaded.

Page Fault Scenario

  • If the CPU requests a page not currently in RAM (e.g., page 2 of Process P1), this results in a page fault requiring service time to retrieve it from disk.
  • A situation arises where multiple requested pages may not be present in RAM, leading to increased page faults and degraded performance.

Consequences of Excessive Multi-programming

  • As more pages are added without sufficient availability for CPU requests, thrashing occurs—characterized by excessive page faults and reduced system efficiency.
  • Graphically represented: as degree of multi-programming increases (x-axis), initially CPU utilization rises (y-axis), but eventually leads to thrashing when too many faults occur.

Solutions to Mitigate Thrashing

  • To alleviate thrashing, increasing main memory size is one option; however, this isn't always feasible due to hardware constraints.

Long Term, Short Term, and Middle Term Scheduling

Responsibilities of Long Term Scheduler

  • The long term scheduler is responsible for maximizing the number of processes in RAM or in a ready state.
  • It aims to bring as many processes into RAM as possible without overwhelming the system.
  • If the long term scheduler decreases its speed, it can help manage the degree of multiprogramming effectively.

Managing Degree of Multiprogramming

  • By controlling the degree of multiprogramming, thrashing can be minimized, which is crucial for maintaining system performance.
Video description

👉Subscribe to our new channel:https://www.youtube.com/@varunainashots A condition in which excessive paging operations are taking place is called Thrashing. A system that is thrashing can be perceived as either a very slow system or one that has come to a halt. ►Operating System (Complete Playlist): https://www.youtube.com/playlist?list=PLxCzCOWd7aiGz9donHRrE9I3Mwn6XdP8p Other subject-wise playlist Links: -------------------------------------------------------------------------------------------------------------------------------------- ►Design and Analysis of algorithms (DAA): https://www.youtube.com/playlist?list=PLxCzCOWd7aiHcmS4i14bI0VrMbZTUvlTa ►Database Management System: https://www.youtube.com/playlist?list=PLxCzCOWd7aiFAN6I8CuViBuCdJgiOkT2Y ► Theory of Computation https://www.youtube.com/playlist?list=PLxCzCOWd7aiFM9Lj5G9G_76adtyb4ef7i ►Artificial Intelligence: https://www.youtube.com/playlist?list=PLxCzCOWd7aiHGhOHV-nwb0HR5US5GFKFI ►Computer Networks (Complete Playlist): https://www.youtube.com/playlist?list=PLxCzCOWd7aiGFBD2-2joCpWOLUrDLvVV_ ►Computer Architecture (Complete Playlist): https://www.youtube.com/playlist?list=PLxCzCOWd7aiHMonh3G6QNKq53C6oNXGrX ►Structured Query Language (SQL): https://www.youtube.com/playlist?list=PLxCzCOWd7aiHqU4HKL7-SITyuSIcD93id ►Discrete Mathematics: https://www.youtube.com/playlist?list=PLxCzCOWd7aiH2wwES9vPWsEL6ipTaUSl3 ►Compiler Design: https://www.youtube.com/playlist?list=PLxCzCOWd7aiEKtKSIHYusizkESC42diyc ►Number System: https://www.youtube.com/playlist?list=PLxCzCOWd7aiFOet6KEEqDff1aXEGLdUzn ►Cloud Computing & BIG Data: https://www.youtube.com/playlist?list=PLxCzCOWd7aiHRHVUtR-O52MsrdUSrzuy4 ►Software Engineering: https://www.youtube.com/playlist?list=PLxCzCOWd7aiEed7SKZBnC6ypFDWYLRvB2 ►Data Structure: https://www.youtube.com/playlist?list=PLxCzCOWd7aiEwaANNt3OqJPVIxwp2ebiT ►Graph Theory: https://www.youtube.com/playlist?list=PLxCzCOWd7aiG0M5FqjyoqB20Edk0tyzVt ►Programming in C: https://www.youtube.com/playlist?list=PLxCzCOWd7aiGmiGl_DOuRMJYG8tOVuapB ►Digital Logic: https://www.youtube.com/playlist?list=PLxCzCOWd7aiGmXg4NoX6R31AsC5LeCPHe --------------------------------------------------------------------------------------------------------------------------------------- Our social media Links: ► Subscribe to us on YouTube: https://www.youtube.com/gatesmashers ►Subscribe to our new channel: https://www.youtube.com/@varunainashots ► Like our page on Facebook: https://www.facebook.com/gatesmashers ► Follow us on Instagram: https://www.instagram.com/gate.smashers ► Follow us on Instagram: https://www.instagram.com/varunainashots ► Follow us on Telegram: https://t.me/gatesmashersofficial ► Follow us on Threads: https://www.threads.net/@gate.smashers -------------------------------------------------------------------------------------------------------------------------------------- ►For Any Query, Suggestion or notes contribution: Email us at: gatesmashers2018@gmail.com