Thrashing Last Updated : 11 Sep, 2025 Comments Improve Suggest changes 76 Likes Like Report Thrashing occurs when the operating system spends more time swapping pages between main memory and disk than executing processes. This leads to excessive page faults and a significant drop in CPU utilization.The cycle works like this:High degree of multiprogramming: Too many processes are loaded into memory.Lack of frames: Each process gets fewer frames than needed.Page replacement policy: Frequent replacements increase page faults.This repeated cycle of low CPU utilization → more processes → more page faults is called Thrashing.Locality ModelThe concept of locality of reference helps explain thrashing:A locality is a set of pages that a program actively uses together.For example, when a function is called, instructions, local variables, and global references define a locality.If the number of frames allocated to a process covers its current locality → few page faults.If frames are fewer than the locality size → frequent page faults → thrashing.Thrashing happens when active localities of multiple processes cannot fit into memory simultaneously.Techniques to Handle Thrashing1. Working Set Model Based on the Locality Model: a process uses a set of pages (locality) actively at a time.If enough frames are allocated to cover the current locality few page faults.If frames < locality size process will thrash.Working Set (WSSᵢ) = pages referenced in the last Δ references (window size).Total demand: D = Σ WSSᵢCases:If D > m (m = available frames) i.e Thrashing occurs.If D ≤ m i.e No thrashing. Accuracy depends on Δ:Large Δ, overlapping working sets.Small Δ, locality may not be fully captured.2. Page Fault FrequencyPFF is a technique to control thrashing by directly monitoring the page fault rate of processes.Working:Define an upper limit and a lower limit for acceptable page fault rate.If fault rate > upper limit, give more frames to the process.If fault rate < lower limit, take away frames.If no free frames are available suspend some processes and reallocate frames. Create Quiz Thrashing in Operating System Visit Course Comment 02DCE Follow 76 Improve 02DCE Follow 76 Improve Article Tags : Operating Systems GATE CS memory-management Explore OS BasicsIntroduction to Operating System5 min readTypes of Operating Systems9 min readKernel in Operating System3 min readSystem Call2 min readWhat happens when we turn on computer?3 min readProcess ManagementIntroduction of Process Management4 min readCPU Scheduling in Operating Systems7 min readIntroduction to Process Synchronization4 min readSolutions to Process Synchronization Problems4 min readClassical IPC Problems2 min readIntroduction of Deadlock in Operating System3 min readHandling Deadlocks2 min readMultithreading in OS - Different Models4 min readMemory ManagementIntroduction to memory and memory units2 min readMemory Management in Operating System5 min readBuddy System - Memory Allocation Technique4 min readOverlays in Memory Management4 min readVirtual Memory in Operating System7 min readPage Replacement Algorithms in Operating Systems5 min readOperating system based Virtualization5 min readI/O ManagementFile Systems in Operating System4 min readImplementing Directory Management using Shell Script3 min readSecondary Memory7 min readDisk Scheduling Algorithms9 min readDifference between Spooling and Buffering5 min readImportant LinksLast Minute Notes â Operating Systems15+ min readOperating System Interview Questions15+ min read Like