Thrashing Flashcards
what is thrashing? what causes it?
high paging to disk activity, process spends more time paging the disk than executing - caused by not having enough frames allocated
caused by too much multiprogramming, each process getting an allocation that is too small
how do we limit thrashing?
using a local replacement algorithm
- page fault evicts a page of the same process
- one process thrashing cannot cause others to thrash by stealing from others
or provide the process with the number of frames it needs
how do we know how many frames a process needs?
define a locality model
- a model of process execution
- process locality is a set of pages actively used together
- proccess moves from locality to locality as it executes
locality of a function is - instruction - local variables - subset of global variables we leave the locality on return from function
how do we use locality?
locality determined by program structure and data structures
allocate enough frames to hold locality
- intially pages in locality are faulted
- no more faulting until locality changes
thrashing occurs when frame allocation is too small to hold locality
what is the working set?
- based on the assumption of locality, the paramater Δ defines the working-set window
- we examine the most recent Δ page references, they are the working set
- if a page is in use, it will be in the set
- if a page is no longer in use, it will be dropped from the set Δ time units after its last reference
- the size may change over time
the demand D is
D = sumof WSSi
where WSS is working set size
thrashing occurs if D is greater than the number of frames