Section 12.2
Review Questions

Virtual memory in action

  1. What do we call the address in a program where execution begins?
answer...
entry point
  1. What is a victim?
answer...
a page whose physical frame is about to be reclaimed for another page
  1. What is the name of the most common algorithm for selecting a victim?
answer...
LRU (Least Recently Used)
  1. What extra piece of information does the above algorithm need in conjunction with each frame of real memory, in order to work properly?
answer...
time stamp (when it was referenced)
  1. Why would it be advantageous to run a large program twice?
answer...
to see when each page will be referenced so the right ones can be kept in memory all the time
  1. What do we mean when we say a page is dirty?
answer...
its data has been changed by memory writes. A dirty page cannot just be thrown away by victim selection. It must be written back to the swap area on disk to avoid losing any data.
  1. Is it possible for a frame to be dirty?
answer...
no, frames are just regions of physical memory that hold pages.
  1. If a computer had 8K of virtual memory, how many address bits would it need?
answer...
13 (log28192 = 13)
  1. If a computer had 8K of virtual memory, and pages were 512 bytes long, how many pages would there be?
answer...
8192 ÷ 512 = 16
  1. Write out in decimal what we mean by the numbers 1K, 4K and 8K.
answer...
1K = 1024, 4K = 4096 and 8K = 8192
  1. Imagine that you are working with a small system that has 8K of virtual memory and 4K of real memory. Each page is 1K long. How many pages and how many frames would there be?
answer...
8 pages, 4 frames
  1. Below is a picture of a small 8K virtual memory address space, along with some memory operations. Next to each, write the page number that the address implies. Also check off the "dirty" column if the page would become dirty by this operation:
answer...