5,130 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 votes
1 votes
1 answer
2
akash.dinkar12 asked Mar 22, 2019
1,114 views
Is it possible for a process to have two working sets, one representing data and another representing code ? Explain.