Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Virtual Memory: A) Processes A) Oldest Page Is Chosen

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Virtual Memory

1. Because of virtual memory, the memory


can be shared among
a) processes
b) threads
c) instructions
d) none of the mentioned

7. 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

2. _____ is the concept in which a process


is copied into main memory from the
secondary memory according to the
requirement.
a) Paging
b) Demand paging
c) Segmentation
d) Swapping

8. 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

3. The pager concerns with the


a) individual page of a process
b) entire process
c) entire thread
d) first page of a process
4. Swap space exists in
a) primary memory
b) secondary memory
c) CPU
d) none of the mentioned
5. 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
6. Effective access time is directly
proportional to
a) page-fault rate
b) hit ratio
c) memory access time
d) none of the mentioned

9. 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
10. Working set model for page
replacement is based on the assumption of
a) modularity
b) locality
c) globalization
d) random access

Demand Paging
1. Virtual memory allows:
a) execution of a process that may not be
completely in memory
b) a program to be larger than the
physical memory
c) a program to be larger than the secondary
storage
d) execution of a process without being in

physical memory
2) The instruction being executed, must be
in :
a) physical memory
b) logical memory
c) None of these
3) Error handler codes, to
handle unusual errors are :
a) almost never executed
b) executed very often
c) executed periodically
d) None of these
.
4) The ability to execute a program that is
only partially in memory has benefits like :
(choose all that apply)
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) CPU utilization decreases
d) Throughput increases
e) response time is not affected
f) turnaround time increases
g) less I/O will be needed to load or swap
each user program in memory
h) All of these
Answer: a, b, d, e, g
5) In virtual memory. the programmer
__________ of overlays.
a) has to take care
b) does not have to take care
c) None of these

Answer: b
6) Virtual memory is normally implemented
by ________.
a) demand paging
b) buses
c) virtualization
d) All of these
Answer: a
7) 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: c
8) 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 these
Answer: c
9) Using a pager :
a) increases the swap time
b) decreases the swap time
c) decreases the amount of
physical memory needed
d) increases the amount of
physical memory needed

Answer: b and c
10) The valid invalid bit, in this case,
when valid indicates :
a) the page is legal
b) the page is illegal
c) the page is in memory
d) the page is not in memory
Answer: a and c
.11) A page fault occurs when :
a) a page gives inconsistent data
b) a page cannot be accesses due to its
absence from memory
c) a page is invisible
d) All of these
Answer: b
12) When a page fault occurs, the state of
the interrupted process is :
a) disrupted
b) invalid
c) saved
d) None of these
Answer: c
13) 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 these
Answer: b
14) 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 these
Answer: c
15) 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) a and b
Answer: c
16) 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: b

Page Replacement Algorithm1


1) Which of the following page
replacement algorithms suffers from
Beladys Anomaly ?
a) Optimal replacement
b) LRU
c) FIFO
d) Both optimal replacement and FIFO
Answer: c

2) 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: c
3) In question 2, if 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 these
Answer: b
4) 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 these
Answer: c
5) 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: c
6) Users _______ that their processes are
running on a paged system.
a) are aware
b) are unaware
c) None of these
7) If no frames are free, _____ page
transfer(s) is/are required.
a) one
b) two
c) three
d) four
Answer: b
8) 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) a and b
Answer: b and c
9) 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: c
10) 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 these
Answer: a
11) Optimal page replacement algorithm
is :
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 these
Answer: c
12) 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: b
13) LRU page replacement algorithm
associates with each page the ______
a) time it was brought into memory
b) the time of that pages last use
c) page after and before it
d) All of these
Answer: b

a) Counters
b) RAM
c) Stack
d) Registers
Answer: a and c

Page Replacement Algorithm2


1) 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: a
Explanation: Whenever a reference to a
page is made, the contents of the clock
register are copied into the time-of-use
field in the page-table entry for that page.
In this way we always have the time of the
last reference to each page.

ii) How many page faults does the FIFO


page replacement algorithm produce ?
a) 10
b) 15
c) 11
d) 12
Answer: b

2) 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 top
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: a and b
.
3) There is a set of page replacement
algorithms that can never exhibit Beladys
Anomaly, called :
a) queue algorithms
b) stack algorithms
c) string algorithms
d) None of the mentioned
Answer: b

15) The two methods how LRU page


replacement policy can be implemented in
hardware are : (choose two)

4) Applying the LRU page replacement to


the following reference string :
12452124

14) For 3 page frames, the following is the


reference string :
70120304230321201701
i) How many page faults does the LRU
page replacement algorithm produce ?
a) 10
b) 15
c) 11
d) 12
Answer: d

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: c
5) 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: c
6) 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: b
Explanation: None.
7) 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: a
8) The reason for using the LFU page
replacement algorithm is :
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
9) The reason for using the MFU page
replacement algorithm is :
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: b
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: c

You might also like