Multiple Choice Questions & Answers on Virtual Memory
Multiple Choice Questions & Answers on Virtual Memory
Virtual Memory MCQ
1. In FIFO page replacement algorithm, when a page must be replaced ____________
a) oldest page is chosen
b) newest page is chosen
c) random page is chosen
d) none of the mentioned
Answer: oldest page is chosen
2. When a program tries to access a page that is mapped in address space but not loaded in physical memory, then ____________
a) segmentation fault occurs
b) fatal error occurs
c) page fault occurs
d) no error occurs
Answer: page fault occurs
3. Working set model for page replacement is based on the assumption of ____________
a) modularity
b) locality
c) globalization
d) random access
Answer: locality
4. Swap space exists in ____________
a) primary memory
b) secondary memory
c) cpu
d) none of the mentioned
Answer: secondary memory
5. Because of virtual memory, the memory can be shared among ____________
a) processes
b) threads
c) instructions
d) none of the mentioned
Answer: processes
6. The pager concerns with the ____________
a) individual page of a process
b) entire process
c) entire thread
d) first page of a process
Answer: individual page of a process
7. Effective access time is directly proportional to ____________
a) page-fault rate
b) hit ratio
c) memory access time
d) none of the mentioned
Answer: page-fault rate
8. A process is thrashing if ____________
a) it is spending more time paging than executing
b) it is spending less time paging than executing
c) page fault occurs
d) swapping can not take place
Answer: it is spending more time paging than executing
9. Which algorithm chooses the page that has not been used for the longest period of time whenever the page required to be replaced?
a) first in first out algorithm
b) additional reference bit algorithm
c) least recently used algorithm
d) counting based page replacement algorithm
Answer: least recently used algorithm
10. _____ is the concept in which a process is copied into the main memory from the secondary memory according to the requirement.
a) Paging
b) Demand paging
c) Segmentation
d) Swapping
Answer: Demand paging
Virtual Memory Demand Paging MCQ
1. Segment replacement algorithms are more complex than page replacement algorithms because ____________
a) Segments are better than pages
b) Pages are better than segments
c) Segments have variable sizes
d) Segments have fixed sizes
Answer: Segments have variable sizes
2. In virtual memory. the programmer __________ of overlays.
a) has to take care
b) does not have to take care
c) all of the mentioned
d) none of the mentioned
Answer: does not have to take care
3. If the memory access time is denoted by ‘ma’ and ‘p’ is the probability of a page fault (0 <= p <= 1). Then the effective access time for a demand paged memory is ____________
a) p x ma + (1-p) x page fault time
b) ma + page fault time
c) (1-p) x ma + p x page fault time
d) none of the mentioned
Answer: (1-p) x ma + p x page fault time
4. Using a pager ____________
a) increases the swap time
b) decreases the swap time
c) decreases the swap time & amount of physical memory needed
d) increases the amount of physical memory needed
Answer: decreases the swap time & amount of physical memory needed
5. Virtual memory allows ____________
a) execution of a process that may not be completely in memory
b) a program to be smaller than the physical memory
c) a program to be larger than the secondary storage
d) execution of a process without being in physical memory
Answer: execution of a process that may not be completely in memory
Explanation: None.
6. The ability to execute a program that is only partially in memory has benefits like ____________
a) The amount of physical memory cannot put a constraint on the program
b) Programs for an extremely large virtual space can be created
c) Throughput increases
d) All of the mentioned
Answer: All of the mentioned
7. Locality of reference implies that the page reference being made by a process ____________
a) will always be to the page used in the previous page reference
b) is likely to be one of the pages used in the last few page references
c) will always be one of the pages existing in memory
d) will always lead to page faults
Answer: is likely to be one of the pages used in the last few page references
8. When a page fault occurs, the state of the interrupted process is ____________
a) disrupted
b) invalid
c) saved
d) none of the mentioned
Answer: saved
9. When the page fault rate is low ____________
a) the turnaround time increases
b) the effective access time increases
c) the effective access time decreases
d) turnaround time & effective access time increases
Answer: the effective access time decreases
10. Error handler codes, to handle unusual errors are ____________
a) almost never executed
b) executed very often
c) executed periodically
d) none of the mentioned
Answer: almost never executed
11. The instruction being executed, must be in ____________
a) physical memory
b) logical memory
c) physical & logical memory
d) none of the mentioned
Answer: physical memory
12. Virtual memory is normally implemented by ________
a) demand paging
b) buses
c) virtualization
d) all of the mentioned
Answer: demand paging
13. A swapper manipulates ___________ whereas the pager is concerned with individual _______ of a process.
a) the entire process, parts
b) all the pages of a process, segments
c) the entire process, pages
d) none of the mentioned
Answer: the entire process, pages
14. When a process begins execution with no pages in memory?
a) process execution becomes impossible
b) a page fault occurs for every page brought into memory
c) process causes system crash
d) none of the mentioned
Answer: a page fault occurs for every page brought into memory
15. The valid – invalid bit, in this case, when valid indicates?
a) the page is not legal
b) the page is illegal
c) the page is in memory
d) the page is not in memory
Answer: the page is in memory
16. A page fault occurs when?
a) a page gives inconsistent data
b) a page cannot be accessed due to its absence from memory
c) a page is invisible
d) all of the mentioned
Answer: a page cannot be accessed due to its absence from memory
Virtual Memory Page Replacement Algorithms MCQ
1. Increasing the RAM of a computer typically improves performance because ____________
a) Virtual memory increases
b) Larger RAMs are faster
c) Fewer page faults occur
d) None of the mentioned
Answer: Fewer page faults occur
2. LRU page – replacement algorithm associates with each page the ______
a) time it was brought into memory
b) the time of that page’s last use
c) page after and before it
d) all of the mentioned
Answer: the time of that page’s last use
3. The aim of creating page replacement algorithms is to ____________
a) replace pages faster
b) increase the page fault rate
c) decrease the page fault rate
d) to allocate multiple pages to processes
Answer: decrease the page fault rate
4. A process refers to 5 pages, A, B, C, D, E in the order : A, B, C, D, A, B, E, A, B, C, D, E. If the page replacement algorithm is FIFO, the number of page frames is increased to 4, then the number of page transfers ____________
a) decreases
b) increases
c) remains the same
d) none of the mentioned
Answer: increases
5. There is a set of page replacement algorithms that can never exhibit Belady’s Anomaly, called ____________
a) queue algorithms
b) stack algorithms
c) string algorithms
d) none of the mentioned
Answer: stack algorithms
6. A memory page containing a heavily used variable that was initialized very early and is in constant use is removed, then the page replacement algorithm used is ____________
a) LRU
b) LFU
c) FIFO
d) None of the mentioned
Answer: FIFO
7. When using counters to implement LRU, we replace the page with the ____________
a) smallest time value
b) largest time value
c) greatest size
d) none of the mentioned
Answer: smallest time value
8. The essential content(s) in each entry of a page table is/are ____________
a) Virtual page number
b) Page frame number
c) Both virtual page number and page frame number
d) Access right information
Answer: Page frame number
9. In the stack implementation of the LRU algorithm, a stack can be maintained in a manner ____________
a) whenever a page is used, it is removed from the stack and put on bottom
b) the bottom of the stack is the LRU page
c) the top of the stack contains the LRU page and all new pages are added to the top
d) none of the mentioned
Answer: the bottom of the stack is the LRU page
10. The implementation of the LFU and the MFU algorithm is very uncommon because ____________
a) they are too complicated
b) they are optimal
c) they are expensive
d) all of the mentioned
Answer: they are expensive
11. The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined by ____________
a) the instruction set architecture
b) page size
c) physical memory size
d) number of processes in memory
Answer: the instruction set architecture
12. When a page is selected for replacement, and its modify bit is set ____________
a) the page is clean
b) the page has been modified since it was read in from the disk
c) the page is dirty
d) the page has been modified since it was read in from the disk & page is dirty
Answer: the page has been modified since it was read in from the disk & page is dirty
13. Optimal page – replacement algorithm is difficult to implement, because ____________
a) it requires a lot of information
b) it requires future knowledge of the reference string
c) it is too complex
d) it is extremely expensive
Answer: it requires future knowledge of the reference string
14. A FIFO replacement algorithm associates with each page the _______
a) time it was brought into memory
b) size of the page in memory
c) page after and before it
d) all of the mentioned
Answer: time it was brought into memory
15. If no frames are free, _____ page transfer(s) is/are required.
a) one
b) two
c) three
d) four
Answer: two
16. Users _______ that their processes are running on a paged system.
a) are aware
b) are unaware
c) may unaware
d) none of the mentioned
Answer: are unaware
17. What is the Optimal page – replacement algorithm?
a) Replace the page that has not been used for a long time
b) Replace the page that has been used for a long time
c) Replace the page that will not be used for a long time
d) None of the mentioned
Answer: Replace the page that will not be used for a long time
18. What is the reason for using the LFU page replacement algorithm?
a) an actively used page should have a large reference count
b) a less used page has more chances to be used again
c) it is extremely efficient and optimal
d) all of the mentioned
Answer: an actively used page should have a large reference count
19. Which of the following page replacement algorithms suffers from Belady’s Anomaly?
a) Optimal replacement
b) LRU
c) FIFO
d) Both optimal replacement and FIFO
Answer: FIFO
20. What are the two methods of the LRU page replacement policy that can be implemented in hardware?
a) Counters
b) RAM & Registers
c) Stack & Counters
d) Registers
Answer: Stack & Counters
21. What is the reason for using the MFU page replacement algorithm?
a) an actively used page should have a large reference count
b) a less used page has more chances to be used again
c) it is extremely efficient and optimal
d) all of the mentioned
Answer: a less used page has more chances to be used again
22. For 3 page frames, the following is the reference string:
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
How many page faults does the LRU page replacement algorithm produce?
a) 10
b) 15
c) 11
d) 12
Answer: 12
23. Applying the LRU page replacement to the following reference string.
1 2 4 5 2 1 2 4
The main memory can accommodate 3 pages and it already has pages 1 and 2. Page 1 came in before page 2.
How many page faults will occur?
a) 2
b) 3
c) 4
d) 5
Answer: 4
24. A process refers to 5 pages, A, B, C, D, E in the order : A, B, C, D, A, B, E, A, B, C, D, E. If the page replacement algorithm is FIFO, the number of page transfers with an empty internal store of 3 frames is?
a) 8
b) 10
c) 9
d) 7
Answer: 9
25. A virtual memory system uses First In First Out (FIFO) page replacement policy and allocates a fixed number of frames to a process. Consider the following statements.
P : Increasing the number of page frames allocated to a process sometimes increases the page fault rate
Q : Some programs do not exhibit locality of reference
Which of the following is TRUE?
a) Both P and Q are true, and Q is the reason for P
b) Both P and Q are true, but Q is not the reason for P
c) P is false but Q is true
d) Both P and Q are false
Answer: P is false but Q is true
Virtual Memory Allocation of Frames MCQ
1. The algorithm in which we split m frames among n processes, to give everyone an equal share, m/n frames is known as ____________
a) proportional allocation algorithm
b) equal allocation algorithm
c) split allocation algorithm
d) none of the mentioned
Answer: equal allocation algorithm
2. One problem with the global replacement algorithm is that ____________
a) it is very expensive
b) many frames can be allocated to a process
c) only a few frames can be allocated to a process
d) a process cannot control its own page – fault rate
Answer: a process cannot control its own page – fault rate
3. The minimum number of frames to be allocated to a process is decided by the ____________
a) the amount of available physical memory
b) operating System
c) instruction set architecture
d) none of the mentioned
Answer: instruction set architecture
4. The algorithm in which we allocate memory to each process according to its size is known as ____________
a) proportional allocation algorithm
b) equal allocation algorithm
c) split allocation algorithm
d) none of the mentioned
Answer: proportional allocation algorithm
5. Consider a machine in which all memory reference instructions have only one memory address, for them we need at least _____ frame(s).
a) one
b) two
c) three
d) none of the mentioned
Answer: two
6. When a page fault occurs before an executing instruction is complete if ____________
a) the instruction must be restarted
b) the instruction must be ignored
c) the instruction must be completed ignoring the page fault
d) none of the mentioned
Answer: the instruction must be restarted
7. The maximum number of frames per process is defined by ____________
a) the amount of available physical memory
b) operating System
c) instruction set architecture
d) none of the mentioned
Answer: the amount of available physical memory
8. ________ replacement generally results in greater system throughput.
a) Local
b) Global
c) Universal
d) Public
Answer: Global
9. With either equal or proportional algorithm, a high priority process is treated ___________ a low priority process.
a) greater than
b) same as
c) lesser than
d) none of the mentioned
Answer: same as
10. _________ replacement allows each process to only select from its own set of allocated frames.
a) Local
b) Universal
c) Global
d) Public
Answer: Local
11. _________ replacement allows a process to select a replacement frame from the set of all frames, even if the frame is currently allocated to some other process.
a) Local
b) Universal
c) Global
d) Public
Answer: Global
Virtual Memory Thrashing MCQ
1. When a subroutine is called ____________
a) it defines a new locality
b) it is in the same locality from where it was called
c) it does not define a new locality
d) none of the mentioned
Answer: it defines a new locality
2. If the sum of the working – set sizes increases, exceeding the total number of available frames ____________
a) then the process crashes
b) the memory overflows
c) the system crashes
d) the operating system selects a process to suspend
Answer: the operating system selects a process to suspend
3. Thrashing _______ the CPU utilization.
a) increases
b) keeps constant
c) decreases
d) none of the mentioned
Answer: decreases
4. A process is thrashing if ____________
a) it spends a lot of time executing, rather than paging
b) it spends a lot of time paging than executing
c) it has no memory allocated to it
d) none of the mentioned
Answer: it spends a lot of time paging than executing
5. If working set window is too large ____________
a) it will not encompass entire locality
b) it may overlap several localities
c) it will cause memory problems
d) none of the mentioned
Answer: it may overlap several localities
6. If working set window is too small ____________
a) it will not encompass entire locality
b) it may overlap several localities
c) it will cause memory problems
d) none of the mentioned
Answer: it will not encompass entire locality
7. The accuracy of the working set depends on the selection of ____________
a) working set model
b) working set size
c) memory size
d) number of pages in memory
Answer: working set size
8. A program is generally composed of several different localities, which _____ overlap.
a) may
b) must
c) do not
d) must not
Answer: may
9. What is a locality?
a) a set of pages that are actively used together
b) a space in memory
c) an area near a set of processes
d) none of the mentioned
Answer: a set of pages that are actively used together
10. 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
For Optimal page replacement algorithms with 3 frames, the number of page faults is?
a) 16
b) 15
c) 14
d) 11
Answer: 11
11. 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
For LRU page replacement algorithm with 4 frames, the number of page faults is?
a) 10
b) 14
c) 8
d) 11
Answer: 10
12. 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
For FIFO page replacement algorithms with 4 frames, the number of page faults is?
a) 16
b) 15
c) 14
d) 11
Answer: 14
13. 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
For FIFO page replacement algorithms with 3 frames, the number of page faults is?
a) 16
b) 15
c) 14
d) 11
Answer: 16
14. 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
For LRU page replacement algorithm with 5 frames, the number of page faults is?
a) 10
b) 14
c) 8
d) 11
Answer: 8
15. In the working set model, for:
2 6 1 5 7 7 7 7 5 1 6 2 3 4 1 2 3 4 4 4 3 4 3 4 4 4 1 3 2 3
if DELTA = 10, then the working set at time t1 (….7 5 1) is?
a) {1, 2, 4, 5, 6}
b) {2, 1, 6, 7, 3}
c) {1, 6, 5, 7, 2}
d) {1, 2, 3, 4, 5}
Answer: {1, 6, 5, 7, 2}
Comments
Post a Comment