5,619 views

1 Answer

0 votes
0 votes

 

Thrashing is caused by under allocation of the minimum number of pages required by a process, forcing it to continuously page fault. The system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multiprogramming. It can be eliminated by reducing the level of multiprogramming.

Ref: https://www.sawaal.com/operating-systems-question-and-answers/what-is-the-cause-of-thrashing-how-does-the-system-detect-thrashing-once-it-detects-thrashing-what-c_3632

How to deal with thrashing?

  • If a single process is too large for memory, there is nothing the OS can do. That process will simply thrash.
  • If the problem arises because of the sum of several processes:
    • Figure out how much memory each process needs.
    • Change scheduling priorities to run processes in groups that fit comfortably in memory: must shed load.

Page Fault Frequency: another approach to preventing thrashing.

  • Per-process replacement; at any given time, each process is allocated a fixed number of physical page frames.
  • Monitor the rate at which page faults are occurring for each process.
  • If the rate gets too high for a process, assume that its memory is over committed; increase the size of its memory pool.
  • If the rate gets too low for a process, assume that its memory pool can be reduced in size.
  • If the sum of all memory pools don't fit in memory, deactivate some processes.

Ref: https://web.stanford.edu/~ouster/cgi-bin/cs140-winter12/lecture.php?topic=thrashing

Related questions

1.4k
views
1 answers
0 votes
akash.dinkar12 asked Mar 22, 2019
1,394 views
Consider the parameter$\triangle$ used to define the working-set window in the working-set model. When $\triangle$ is set to a small value, what is the effect on the ... ? What is the effect when $\triangle$ is set to a very high value ?
1.1k
views
1 answers
1 votes
akash.dinkar12 asked Mar 22, 2019
1,149 views
Is it possible for a process to have two working sets, one representing data and another representing code ? Explain.
554
views
0 answers
0 votes
akash.dinkar12 asked Mar 22, 2019
554 views
Consider a demand-paging system with a paging disk that has an average access and transfer time of $20$ milliseconds. Addresses are translated through a page ... of the total) cause page faults. What is the effective memory access time?
945
views
0 answers
1 votes
akash.dinkar12 asked Mar 22, 2019
945 views
A page-replacement algorithm should minimize the number of page faults. We can achieve this minimization by distributing heavily used pages evenly over all of memory, ... strategy for the reference string in part $b$ with four page frames?