Notes-Thrashing, Design Issues For Paging Systems
Notes-Thrashing, Design Issues For Paging Systems
4. Definition of Thrashing:
- The system enters a state where page faults occur frequently across processes,
impeding progress.
- This state, characterized by excessive page faults and minimal forward progress, is
termed "thrashing."
Additional Insights:
- Resource Contentions:
- Thrashing occurs due to resource contention for physical memory among processes.
- It reflects a scenario where the system spends more time swapping pages than executing
useful work.
- Identification of Thrashing:
- Thrashing can be identified by monitoring metrics such as page fault rates and CPU
utilization.
- A sudden surge in page faults accompanied by decreased CPU utilization suggests
thrashing.
- Mitigation Strategies:
- Effective memory management techniques are essential to mitigate thrashing.
- Strategies include optimizing page replacement algorithms, adjusting process priorities,
and increasing physical memory capacity.
Load Control
The system can thrashes even with the best page replacement algorithm and optimal
global allocation of page frames to processes.
Whenever the combined working sets of all processes exceed the capacity of memory,
thrashing can be expected.
One symptom of this situation is the PFF algorithm indicates that some processes
need more memory but no processes need less memory.
In this case, there is no way to give more memory to those processes needing it
without hurting some other processes.
The real solution is to temporarily get rid of some processes.
A good way to reduce the number of processes competing for memory is to swap
some of them to the disk and free up all the pages they are holding.
The freed page frames can be divided up among other processes that are thrashing
If the thrashing stops, the system can run for a while this way
If thrashing does not stop, swapping of processes continues until thrashing stops.
Another factor to consider is the degree of multiprogramming.
When the number of processes in main memory is too low, the CPU may be
idle for substantial periods of time.
Page Size
The page size is a parameter that can be chosen by the operating system.
Determining the best page size requires balancing several competing factors
The factor argues for a small page size
• A randomly chosen text, data, or stack segment will not fill an integral number
of pages
• On the average, half of the final page will be empty, the extra space in that
page is wasted which is called internal fragmentation
On the other hand, small pages mean that programs will need many pages, and thus a
large page table