0% found this document useful (0 votes)
61 views5 pages

Notes-Thrashing, Design Issues For Paging Systems

The document discusses thrashing, a state where excessive page faults occur due to the working set sizes of processes exceeding physical memory capacity, leading to performance degradation. It highlights the importance of effective memory management strategies, including local versus global allocation policies, load control, and optimal page size to mitigate thrashing. Additionally, it emphasizes the operating system's role in detecting and resolving thrashing to ensure optimal system performance and resource utilization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views5 pages

Notes-Thrashing, Design Issues For Paging Systems

The document discusses thrashing, a state where excessive page faults occur due to the working set sizes of processes exceeding physical memory capacity, leading to performance degradation. It highlights the importance of effective memory management strategies, including local versus global allocation policies, load control, and optimal page size to mitigate thrashing. Additionally, it emphasizes the operating system's role in detecting and resolving thrashing to ensure optimal system performance and resource utilization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Thrashing: Understanding the Concept

1. Page Replacement Algorithms Limitation:


- All page replacement algorithms face a fundamental challenge.
- When the combined sizes of the working sets of processes exceed physical memory
capacity, a problem arises.

2. Working Set Size and Memory Capacity:


- The working set of a process refers to the set of pages it actively uses during execution.
- If the sum of working set sizes exceeds physical memory size, all pages cannot be
accommodated simultaneously.

3. Consequence: Frequent Page Faults:


- When memory cannot hold all necessary pages, every page fault evicts a page from a
process's working set.
- Evicted pages are likely to be accessed again soon, triggering another page fault.
- This cycle leads to frequent page faults across processes.

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."

5. Guaranteeing System Responsiveness:


- To ensure a system remains responsive, processes must be preemptable.
- Preemption allows the operating system to allocate resources to new processes when
necessary.
- However, insufficient memory can hinder preemptability, leading to system-wide
performance degradation.

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.

- Impact on System Performance:


- Thrashing severely impacts system performance and responsiveness.
- It results in poor overall throughput, longer response times, and diminished user
experience.

- Role of Operating System:


- The operating system plays a critical role in detecting and resolving thrashing.
- Through proactive memory management and scheduling policies, it aims to prevent or
minimize thrashing occurrences.

By understanding the dynamics of thrashing and implementing appropriate mitigation


strategies, system administrators and developers can ensure optimal performance and
resource utilization in computing environments.
DESIGN ISSUES FOR PAGING SYSTEMS
Following are the issues that operating system designers must consider carefully in order to
get good performance from a paging system.
• Local versus Global Allocation Policies
• Load Control
• Page Size

Local versus Global Allocation Policies


A major issue associated with page replacement algorithm is how memory should be
allocated among the competing runnable processes.

Fig. Local versus global page replacement.


(a) Original configuration.
(b) Local page replacement.
(c) Global page replacement.
 In the figure, three processes, A, B, and C, make up the set of runnable processes.
 Suppose A gets a page fault.
• Should the page replacement algorithm try to find the least recently used page
considering only the six pages currently allocated to A, or should it consider
all the pages in memory?
 If it looks only at A’s pages, the page with the lowest age value is A5, so we get the
situation of Fig. (b), called local page replacement algorithm
 If the page with the lowest age value is removed without regard to whose page it is,
page B3 will be chosen and we will get the situation of Fig. (c) called global
algorithm
 Local algorithms effectively correspond to allocating every process a fixed fraction of
the memory.
 Global algorithms dynamically allocate page frames among the runnable processes.
 Thus, the number of page frames assigned to each process varies in time.
 Global algorithms work better, especially when the working set size can vary a lot
over the lifetime of a process.
 If a local algorithm is used and the working set grows, thrashing will result, even if
there are a sufficient number of free page frames.
 If the working set shrinks, local algorithms waste memory.
 If a global algorithm is used, the system must continually decide how many page
frames to assign to each process.
 If a global algorithm is used,
• It may be also possible to start each process up with some number of pages
proportional to the process’ size, but
• The allocation has to be updated dynamically as the processes run.
 One way to manage the allocation is to use the PFF (Page Fault Frequency)
algorithm.
 It tells when to increase or decrease a process’ page allocation but says nothing about
which page to replace on a fault.
 It just controls the size of the allocation set.

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

You might also like