Answers to

Test #2

CIS343 - November 18, 2002

 

(1-6) Identify these memory management techniques.

1. Partitions are created as needed, so that each process is loaded into a partition of exactly the same size as the process.

                   dynamic partitioning

 

2. Main memory is divided into a number of equal-size frames.  Each process is divided into a number of equal-size units, of the same size as the frames.

                   simple paging

 

3. Same as above, except that not all pages are resident at any one point in time.

                   virtual memory, paging

 

4. Main memory is divided into a number of static partitions at system generation time.

                   fixed partitioning

 

5. Each process is divided into a number of segments, all of which are loaded into memory at run time, though not necessarily contiguously.

                   simple segmentation

 

6. The same as above, except that not all segments are resident at any one point in time.

                   virtual memory segmentation

 

(7-9) Identify these terms related to relocation.

7. A reference to a memory location independent of the current assignment of data to memory.

                   logical address

 

8. An address expressed as a location relative to some known point.

                   relative address

 

9. An absolute address, an actual location in main memory.

                   physical address

 

(10-12) Identify these terms related to paging and segmentation.

10. The equal-size chunks that a process is divided into.

                   pages

 

11. The equal-size chunks that memory is divided into.

                   frames

 

12. The chunks that a program is divided into which are not necessarily all of the same length.

                   segments

 

(13-18) Identify the memory management technique which has the following strengths (list all that apply):

13. No internal fragmentation

          dynamic partitioning

          simple paging

          virtual memory, segmentation

                  

14. Higher degree of multiprogramming

          virtual memory, paging

          virtual memory, segmentation

                  

15. Large virtual address space

          virtual memory, paging

          virtual memory, segmentation

                  

16. Protection and sharing support

          virtual memory, segmentation

                  

17. Simple to implement; little OS overhead

          fixed partitioning

                  

18. No external fragmentation

          simple paging

          virtual memory, paging        

 

(19-24) Identify the memory management technique which has the following weakness

(list all that apply):

19. Overhead of complex memory management

          virtual memory, paging

          virtual memory, segmentation

                  

20. A small amount of internal fragmentation

          simple paging

          virtual memory, paging        

                  

21. Inefficient use of memory due to internal fragmentation

          fixed partitioning

                  

22. Inefficient use of processor due to need for compaction to counter external fragmentation

          dynamic partitioning

                  

23. There is no simple relationship between logical addresses and physical addresses.

          segmentation

                  

24. Maximum number of active processes is fixed.

          fixed partitioning

                  

(25-27) Identify these hardware features used in support of program relocation and paging.

25. Contains the address at which a program is loaded.

          base register

                  

26. Contains the address of the last memory location allocated to the code + data.

          bounds register

                  

27. Used to check the address of a memory access against the bounds register.

          comparator

 

(28-32) Identify the five requirements that memory management is intended to satisfy.

28. Allow controlled access to the same area of memory by more than one process.

                   sharing

 

29. Providing for the programmer useful concepts for program organization, which may or may not have exact physical parallels.

                   logical organization

 

30. Provide for parts of (or all of) a program to occupy different areas of memory at different times during execution.

                   relocation

 

31. Prevent processes from interfering with each other, whether by accident or intentionally.

                   protection

 

32. The task of finding areas of main memory and secondary memory for a program and of moving information between the two levels of memory.

                   physical organization

 

(33-39) Dynamic run-time address translation is considered a fundamental breakthrough in memory management.  It can be described thus:

33. All memory references within a process are _____.

        logical addresses

34. These are dynamically translated into _____ at run time.

        physical addresses

35. Therefore, a process can occupy _____ of memory at different times during the course of execution.

        different regions

36. As a consequence, a process can be broken into _____.

        a number of pieces

37. T/F: But, during execution, these pieces must be contiguous to each other when transferred to main memory.

        False

38-39. The two pieces of a process that must be in main memory in order for execution to proceed are the piece that holds the next _____ and the piece that holds the next _____.

        instruction to be fetched

        data location to be accessed

 

40-42. When paging is implemented the logical address (the address referenced by a process) is translated into a _____ address, consisting of a _____ and an _____.

        virtual

        page number

        offset

43-45. This, in turn, is translated into a _____ and an _____, which is used to compute the _____ address.

        frame number

        offset

        real

46-47. Under segmentation the virtual address is translated into a _____ and an _____.

        segment number

        offset

48-50. This is then translated into a _____ and an _____ which, in turn, yields the _____.

        base address

        offset

        real address

51-53. Under segmentation/paging the virtual address is translated into a _____, a _____, and an _____.

        segment number

        page number

        offset

 

(54-58) Listed below are considerations relevant to the choice of page size.  Identify which argue for larger, and which for smaller page size.

54. Desire to increase the number of page frames available to a process

        smaller

55. Physical characteristics (rotational) of most secondary storage devices.

        larger

56. Desire to decrease the number of page faults by appeal to principle of locality

        smaller

57. Desire to decrease internal fragmentation.

        smaller

58. Desire to decrease size of page tables

        larger

 

(59-60) Identify these fetch policies:

59. A page is brought into main memory only when a reference is made to a location on that page.

        demand paging

60. Pages are brought in anticipating their later use.

        prepaging

 

(61-64) Identify these page replacement policies:

61. Replace the page whose used bit is 0 (resetting that bit as the page is passed over)

        Clock

62. Replace the page for which the time to next reference is the longest.

        optimal

63. Replace the page which has not been referenced for the longest time.

        LRU (least recently used)

64. Replace the page which has been in memory the longest.

        FIFO (first in, first out)

 

65. In the modification of Clock (modClock) using two bits (u - used; m - modified), there are 4 possible combinations of u & m: 0-0, 0-1, 1-0, 1-1.  Which combination is chosen during Step #1 of modClock?

        0-0

66. Which combination is chosen during Step #2 of modClock?

        0-1

67. If Step #2 fails, Step #3 involves . . .

        A repetition of Step #1, and then Step #2, if necessary

        Wrong: A repetition of Step #1 only

68.  T/F: The Optimal page replacement strategy has been proven to be the best.

        true

69. T/F: The best operating systems use the Optimal page replacement strategy.

        false

 

(70-71) Identify these resident set management policies:

70. Give a process a fixed number of pages within which to execute.

        fixed allocation policy

71. Allow the number of page frames allocated to a process to change over the lifetime of a process.

        variable allocation policy

 

(72-73) Identify these scope of replacement policies:

72. Choose only among the resident pages of the process that generated the page fault to find a page to replace.

        local replacement policy

73. All unlocked pages in memory are candidates for replacement, regardless of which process they belong to.

        global replacement policy

 

74. Among the 4 possible combinations of resident set management and replacement policies, which one is not possible?

        fixed allocation, global scope

75. The set of pages that a process is accessing over a period of time is known as its . . .

        working set

76. The set of pages of a process that are actually in memory.

        resident set

 

(77-79) Complete these sentences which state three problems with the working set strategy.

77. The past . . .

        does not always predict the future

78. A true measurement of the working set of each process is . . .

        impractical

79. The optimal value of ??(the window size) is . . .

        unknown

 

(80-81) Identify these cleaning policies:

80. A page is written out to secondary memory only when it is selected for replacement.

        demand cleaning

81. Modified pages are written before page frames are needed, so that pages can be written out in batches.

        precleaning

82. Good load control is critical to effective memory management.  If too few processes are resident, it could lead to _____.

        excessive swapping

83. Why?

        all processes are blocked

84. If too many processes are resident, it could lead to _____.

        frequent faulting

85. Why?

        inadequate resident size for resident processes

 

(86-91) Classify each of these memory management strategies in one of 4 categories:

        I-Y  E-Y  :: internal fragmentation - yes; external fragmentation - yes

        I-N  E-Y  :: internal fragmentation - no; external fragmentation - yes

        I-Y  E-N  :: internal fragmentation - yes; external fragmentation - no

        I-N  E-N  :: internal fragmentation - no; external fragmentation - no

86. Fixed partitioning

        I-Y  E-N

                   internal fragmentation; no external fragmentation

 

87. Dynamic partitioning

        I-N  E-Y

                   no internal fragmentation; external fragmentation

 

88. Simple paging

        I-Y  E-N

          no external fragmentation; a small amount of internal fragmentation

 

89. Simple segmentation

        I-N  E-Y

                   no internal fragmentation; some external fragmentation

 

90. Virtual memory paging

        I-Y  E-N

          no external fragmentation; a small amount of internal fragmentation

 

91. Virtual memory segmentation

        I-N  E-Y

                   no internal fragmentation