ENVS 1800 Lecture 5: ENVS 1800 Tutorial 5 Notes
![](https://new-preview-html.oneclass.com/aAyDl2zeo7d4jWY9W56rQ83M69wRbkvx/bg1.png)
ENVS 1800 Tutorial 5 Notes – Thrashing
Introduction
• Both second chance algorithms reduce the number of disk swaps by keeping what
would otherwise be swapped-out pages in memory.
• However, the first of these algorithms has the potential of keeping a page beyond its
usefulness
• The second decreases the number of possible pages in memory by using some of those
pages for the free pool.
• A condition that can arise when a system is heavily loaded is called thrashing.
• Thrashig is every syste adiistrator’s ightmare.
• Thrashing occurs when every frame of memory is in use, and programs are allocated just
enough pages to meet their minimum requirement.
• A page fault occurs in a program, and the page is replaced by another page that will
itself be needed for replacement almost immediately.
• Thrashing is most serious when global page replacement is used.
• In this case, the stolen page may come from another program.
• When the second program tries to execute, it is immediately faced with its own page
fault.
• Unfortunately, the time required to swap a page from the disk is long compared to CPU
execution time
• As the page fault is passed around from program to program, no program is able to
execute, and the system as a whole slows to a crawl or crashes.
• The programs simply continue to steal pages from each other.
• With local page replacement, the number of thrashing programs is more limited, but
thrashing can still have a serious effect on system performance.
• As we mentioned previously, the data in the page table must be stored in memory.
• The first of these algorithms has the potential of keeping a page beyond its usefulness
find more resources at oneclass.com
find more resources at oneclass.com