[prev] 49 [next]

Page Replacement

What happens when a page is replaced?
  • if it's been modified since loading, save to disk **
    (in the disk-based virtual memory space of the running process)
  • grab its frame number and give it to the requestor
How to decide which frame should be replaced?
  • define a "usefulness" measure for each frame
  • grab the frame with lowest usefulness (e.g. priority queue?)

** we need a flag to indicate whether a page is modified

#define NotLoaded   0x00000000
#define Loaded      0x00000001
#define IsModified  0x00000002