Test 3 - Memory Management

CS 505, Operating Systems Concepts


  1. Suppose a system uses physical addresses in its limit register. What kind of virtual memory does the system support? Explain.


    It supports segmented virtual memory. The limit register contains the largest address a program can legally access. Putting a physical address in the limit register doesn't make sense for paged virtual memory for a number of reasons:

    1. A page can occupy any page frame in primary store.

    2. A page can be moved to any other page frame in primary store.

    3. Pages need not be contiguous in primary store.

    A lot of people got this wrong by not answering the question. The answers were all over the place, with no particular pattern to them.


  2. Suppose a program is exhibiting essentially random locality of reference. What is the proper working-set window size for such a program? Explain.


    The working-set window size should be small. Because there is no locality, the sequence of references seen in any window size is essentially going to be random, which translates into a working size set proportional to the window size. Larger window sizes penalizes other processes that do exhibit locality of reference (by hogging up page frames), and it's better to penalize the process with poor locality than to penalize processes that are good citizens with respect to their working sets.

    Most people got this mostly right, although the reasoning could have been stronger and more direct. A number of people tried to make a thrashing argument, but thrashing occurs between processes and not within a single process and, given a large set of randomly selected pages, it's unlikely that one paged out will be needed in the immediate future given random access.


  3. Explain the relation between a working-set policy and a LRU policy.


    Both are page selection policies that determine which page should be flushed when a page frame has to be cleared. The LRU policy selects the page that hasn't been accessed in the longest time. The working-set policy protects those pages that have been accessed recently.

    Answers to this one were all over the place, largely because the question wasn't as clear as I though it was. Long and rambly answers did less well than answers that just stated the points and stopped.


  4. Suppose you are designing an operating system that allows pages to be shared among processes. Should you chose a regular or an inverted page table to supporting shared pages? Justify your answer.


    A page table maps a process's page to a physical memory page frame. It is easy to use a page table to sharing a page among a set of processes: just make sure the corresponding page-table entry in each process references the same page frame.

    An inverted page table maps a page frame to a process's page. To share a page among a set of processes, the inverted page table has to map page frames to sets of process pages, which is not directly supported by the inverted page table.

    It seems that page tables would be easier to use than would be inverted page tables when implementing page sharing.

    Most people got this wrong, mostly by confusing page and inverted page tables. I cut some slack for people who got the argument right but the names wrong, as I did (although less so) for the couple of people who gave the right argument but came to the wrong conclusion.



This page last modified on 21 August 2002.