Assignment 4 


  1. Consider a swapping system in which memory consists of the following hole sizes in memory order: 10K, 4K, 20K, 18K, 7K, 9K, 12K, and 15K. Which hole is taken for successive segment requests of: 

for first fit? Now repeat the question for best fit, worst fit, and next fit.

  1. If an instruction takes 1 microsec and a page fault takes an additional n microsec, give a formula for the effective instruction time if page faults occur every k instructions.
  2. A computer with a 32-bit address uses a two-level page table. Virtual addresses are split into a 9-bit top-level page table field, and 11-bit second-level page table field, and an offset. How larege are the pages and how many are there in the virtual address space?
  3. A machine has 48-bit virtual addresses and 32-bit physical addresses. Pages are 8K. How many entries are needed for a conventional page table? For an inverted page table?
  4. Explain for both paging and segmentation, how address translation from virtual address to physical address happens.
  5. In modern operating systems, mention all the way of determining the resident set size of a process.
  6. If FIFO page replacement is used with four page frames and eight pages, how many page faults will occur with the reference string 0172327103 if the four frames are initially empty? Now repeat this for LRU.
  7. Assume that virtual address space of a virtual memory system is 10MB, and page size is 1KB.  Each entry in the page table is 4 bytes.  How much memory is required for page tables of 10 processes?  Assume no swapping occurs for page tables.
  8. Consider the following page-reference string: 1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6.  How many page faults would occur for the following replacement algorithms, assuming one, two, three, four, five, six, or seven frames?  Remember that all frames are initially empty, so your first unique pages will all cost one fault each. 1) LRU replacement 2) FIFO replacement 3) Optimal replacement.
  9. What is the cause of thrashing? How does the system detect thrashing?  Once it detects thrashing, what can the system do to eliminate this problem?
  10. A computer has four page frames.  The time of loading, time of last access, and the R (Reference/Use bit) and M(Modified bit) for each page are shown below (the times are in clock ticks):
Page Loaded Last Referenced R M
0 126 279 0 0
1 230 260 1 0
2 120 272 1 1
3 160 280 1 1

 a) Which page will FIFO replace?    b) Which page will LRU replace?    c) Which page will second chance replace?