CITS2002 Systems Programming  
prev
CITS2002 CITS2002 schedule  

Virtual Memory Implementation Considerations, continued

  1. Which existing blocks should be replaced?

    i.e. what is the replacement policy?

    To avoid thrashing, we wish to replace only pages unlikely to be required soon, but this must be balanced against how many frames can be allocated to a process, and if the Running process's pages should be displaced (a local policy) or if other processes' pages can be displaced (a global policy).

    A number of replacement algorithms exist (seemingly a preoccupation of 1970's OS research) which select pages to be replaced.

    Fundamental algorithms include first-in, first-out (obvious, but disadvantages long-running programs with high locality) and least-recently-used (almost ideal, but requires time-expensive hardware to maintain time-stamps on page usage).

  2. How many processes to admit to the Ready and Running states?

    The degree of multi-programming permitted must balance processor utilisation (minimising idle time due to I/O blocking) against utility (many processes executing with small resident set sizes and possible thrashing).

No-one, yet, claims memory management is easy.

 


CITS2002 Systems Programming, Lecture 14, p8, 12th September 2023.