Thrashing in OS

Thrashing क्या है?

Thrashing एक ऐसी स्थिति है जब system बार-बार pages को RAM और disk के बीच swap करता रहता है और actual work बहुत कम होता है।

मतलब:
System का ज्यादा time page swapping में चला जाता है, execution में नहीं।

Basic Concept

  • RAM में pages की कमी होती है
  • बार-बार page fault होते हैं
  • OS लगातार pages को load और replace करता रहता है
  • CPU idle रहता है या कम काम करता है

How Thrashing Occurs

  1. System में बहुत सारे processes होते हैं
  2. हर process को ज्यादा memory चाहिए होती है
  3. RAM में enough frames नहीं होते
  4. बार-बार page fault होता है
  5. OS लगातार swapping करता रहता है

Result:
System slow हो जाता है

Symptoms of Thrashing

  • CPU utilization कम हो जाता है
  • Page faults बहुत ज्यादा हो जाते हैं
  • System बहुत slow हो जाता है
  • Disk activity बढ़ जाती है

Causes of Thrashing

  • High degree of multiprogramming
  • Insufficient memory
  • Poor page replacement algorithm
  • Large processes

Prevention of Thrashing

  • Processes की संख्या कम करें
  • Memory increase करें
  • Efficient page replacement algorithm use करें (जैसे LRU)
  • Working set model का use करें

Example (Conceptual)

मान लो:

RAM में 3 frames हैं
लेकिन processes को 6 pages चाहिए

तो:

  • हर बार नया page आएगा
  • पुराना page हटेगा
  • फिर वही page फिर से चाहिए होगा

Result:
बार-बार swapping → Thrashing

Short Conclusion (Exam Ready)

Thrashing एक condition है जिसमें system बार-बार page swapping करता रहता है और CPU utilization कम हो जाता है। यह insufficient memory और high multiprogramming के कारण होता है और system performance को बहुत slow कर देता है।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top