[an error occurred while processing this directive]

CS 5631 Study Questions and Homework

Memory Management (Chapters 9 and 10)

Homework 4

Homework (5 points) due Tuesday, March 9, 2004.

For Homework 4, turn in your answers for the following study questions: 2, 3 (2 points), 4, and 6.

Homework 5

Homework (6 points) due Tuesday, March 24, 2004.

For Homework 5, turn in your answers for the following study questions: 8, 9 (2 points), and 12 (2 points).

Study questions

  1. List three algorithms for allocation of memory in systems using variable-size partitions?

  2. What is the difference between internal and external fragmentation? When do you get internal fragmentation and when do you get external fragmentation?

  3. An operating system that uses demand paging with a global replacement algorithm will usually need to maintain both a global table and a table for each process.

    1. Are the global tables indexed by logical page number or physical frame number?
    2. Are the process tables indexed by logical page number or physical frame number?
    3. In general terms, describe what must be done when replacing a page.
    4. Why is it necessary to know what process is using a frame?
    5. What is the purpose of the global tables?
    6. What is the purpose of the per-process tables?

  4. What is a translation look-aside buffer? Why is it needed?

  5. How is memory protection accomplished in a paged memory environment?

  6. How can two processes share memory in a paged memory environment?

  7. What are some advantages of using virtual memory?

  8. What are the two main types of virtual memory systems? Which is more commonly used in a pure form?

  9. Suppose we are using demand-paged memory with a memory access time of 100 nanoseconds, and it takes 8 milliseconds to service a page fault without a dirty-page write and 20 milliseconds with dirty-page write. Assuming that a dirty-page write occurs on 70 percent of all page faults, what is the maximum page fault rate for an effective access time of 200 nanoseconds?

  10. Consider the following page reference string

    1,2,7,8,3,4,2,1,4,2,5,6,2,1,2,4,7,3,6,3,2,1,2,3,6.
    

    How many page faults would occur for the following page replacement algorithms assuming an allocation of 3 frames?

    1. LRU
    2. FIFO
    3. Optimal

  11. Define what it means for a process to be thrashing?

  12. You are given the following information about a paged virtual memory system with 2 level page tables: A process is using 12MB of memory for program and data in low memory and 1MB for stack in high memory.
    1. How large are top-level page tables?
    2. How large are low-level page tables?
    3. What is the total page table size for the process?

  13. A computer manufacturer announced a new computer model that will have a page size of 4K bytes instead of 512 bytes. Discuss how this will affect the sizes of the following:
    1. Memory fragmentation
    2. Page table size
    Which is more important?

  14. How are paging and segmentation combined in Pentium processors?

  15. In a paged virtual memory system that provides copy-on-write pages, the operating system initially makes copy-on-write pages unwritable. Why?

  16. Processors that support virtual memory have special instructions for modifying the translation-lookaside buffer. Why? Would these instructions be executable in user mode?

  17. Some operating systems reserves a portion of each process's logical address space, making it illegal for the process to access that data. What must the operating system do in order to access this data? Why might it be desirable for an operating system to reserve this address space?

[an error occurred while processing this directive]