Showing posts with label IS215 - Memory Management. Show all posts
Showing posts with label IS215 - Memory Management. Show all posts

Saturday, November 24, 2007

IS215 - Memory Management Exercises - 2

11. Discuss the factors that may affect the performance of a paging system. For each of the sequence of page requests given below, and assuming a store size of four page frames, give the optimum sequence of page fetches and replacements and also, the sequence which would be generated if the replacement algorithm used is LRU. Do the same for FIFO. Comment on the results obtained.

a) 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3
b) 1, 2, 1, 3, 1, 4, 1, 5, 1, 2, 1, 3, 1, 4, 1, 5, 1, 2
c) 1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1, 2
d) 1, 2, 3, 4, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 2, 3, 4, 5

12. With the sequence of page requests given in (11a-11d), give the contents of the memory for each sequence. Assume that the memory is initially empty and the working set is 4 pages at any instant.

13. Outline a possible structure for page and segment tables. Explain how an associative memory may be used to reduce effective access time. Show that if p% of accesses fail to match entries in the associative store then, in a page segmented addressing system, there will be a slow down of p%.

14. Local page replacement policy is prone to thrashing. Argue for or against this statement.

15. Paged segmentation was designed to combine the advantages of paging and segmentation. Hence there are problems present in

a) paging alone; and
b) segmentation alone

which are not in paged segmentation. List all these problems.

16. Demand and anticipatory fetch policies can be combined together. Outline a system that combines these two fetch policies.

17. Discuss how thrashing is avoided when the working set of a process is determined in advance.

18. Consider a swapping system. Measured utilization are:

CPU utilization - 20%
Swapping device (drum) - 99.7%
Other I/O devices - 5%

What will be the effect on CPU utilization if we

a) get a faster CPU
b) get a bigger hard disk for swapping
c) increase the degree of multiprogramming
d) decrease the degree of multiprogramming
e) get faster other I/O devices.

19. Consider a swapping system in which the memory is composed of the following hole sizes (assuming the leftmost hole is the first in the list):

10K, 4K, 20K, 18K, 9K, 12K, 15K

Which hole is taken for successive segment=requests of 12K, 5K, 10K for first-fit? Repeat the question for best-fit and worst-fit.

20. Which of the following programming techniques and structures are ideal for paging. Support your answer.

a) sequential search
b) binary search
c) array operations
d) stack operations

Which is ideal for segmentation?

IS215 - Memory Management Exercises - 1

Exercises

1. When binding of addresses to memory locations is done at execution time, relocation 'is less expensive than when binding is done at compile time. Explain.

2. The main problem of Multiprogramming with Fixed Number of Tasks is internal fragmentation while that of Multiprogramming with Variable Number of Tasks is external fragmentation. Explain.

3. Define swapping. What are the motivations for providing swapping? Show how this technique enables a reasonable response time to be given to each user of an interactive system. In what situation is swapping not effective?

4. Why is CPU utilization improved when swapping is upgraded from that where only one user process is allowed in memory at a time to one where more than one user process is allowed in memory at a time.

5. Outline one method of protecting the memory of a multi-user system. Specifically answer the question of how to protect the systems area (without totally preventing other users from accessing the said area as long as it is done correctly) and the areas allocated to other users.

6. Compaction usually introduces a high overhead because it has to consider the binding of user's variables to memory locations. Explain.

7. Differentiate temporal from spatial locality. Illustrate the two using access to the memory by the computer system.

8. Why is it impossible to share the code of a process that allows modification on the code itself.

9. Given the following segment table:
Segment NumberBaseLimit
050150
11000100
2500200
325050

What are the equivalent real addresses of the following virtual addresses:

a) (0, 10)
b) (1, 150)
c) (2,100)
d) (3, 25)

10. Assuming a page frame size of 1024 and given the following page table:
Page NumberBase
01024
13072
25120
32048

What are the equivalent real addresses of the following virtual addresses:
a) (0, 64)
b) (1, 1048)
c) (2, 1)
d) (3, 1024)