Thrashing in OS

Thrashing in OS is an issue when virtual memory is in use

Thrashing Meaning:

Thrashing is a condition in which excessive paging operations are taking place.It is the situation where process spends more time in processing page faults than executing instructions of processes.

Thrashing Definition and Concept:

Thrashing in OS is defined as, “it is condition and situation where system is major portion of time in serving the page fault or swapping the pages.

Why Trashing Occurs:

After increasing the degree of multi-programming then it may requires more frames. When this happens, a pattern typically develops in which a request is made of the operating system by a process or program to find resources by taking them from some other process, which in turn makes new requests that can’t be satisfied.

These processes need those pages, however and so they also fault and take frames from other processes.

All these faulting processes then queues up for the paging device to swap pages in and out. As processes wait for paging device till CPU utilization is decreases.

As a result CPU utilization decreases in chained reaction of higher page faults followed by an increase in the degree of multi-programming called as thrashing.

Thrashing is also known as a disk scheduling.

Effect of thrashing on system:

Whenever thrashing starts then
Can cause slowdown of the system performance in terms of data transfer between the hard drive (secondary memory) and physical memory (Main memory).

Application may stops responding.

Techniques to handle thrashing in OS:

I] Working Set Model

II] Page Fault Frequency:

I] Working Set Model:It is based on locality. In this, the page used recently or actively can be used again and also the pages which are nearby this page will also be used.

II] Page Fault Frequency:Allocate and suspend the process as per the requirement and availability of frames.

Leave a Reply