virtual memory exam questions and answers

 Virtual Memory Exam Questions and Answers

Briefly-Question-Answers

Define Virtual memory. What is its main advantage?

Virtual memory is a logical technique that allows the execution of processes that are not completely in the main memory of a computer system. Only the main pages of a process are loaded into memory while the remaining pages are kept on the backing store. The main advantage of the virtual memory technique is that it allows users to execute processes that are larger than the actual size of physical memory.

What do you know about demand paging?

Demand paging is a logical technique, which is commonly used to implement virtual memory in a system. This logical technique has combined features of simple paging and overlaying in a system. In a demand-paged system, each page of a process is stored contiguously in the paging swap space on secondary storage (disk). With demand paging, a page is loaded into main memory only when it is needed (or demanded) during process execution.

What is meant by page fault?

A page fault is a trap to the software used by the hardware when a process tries to access a page that is mapped in the virtual address space but not loaded in physical memory.

Describe the page replacement algorithm and reference string?

Page replacement is a technique used to free a frame in memory. The algorithm that is used to select a page to be swapped out is called the page replacement algorithm.
A page replacement algorithm is usually evaluated by running it on a particular string of memory references and computing the resulting number of page faults. The string of memory references in a computer network system is known as a reference string.

A string reference for the pages is given below.

9,3,0,1,2,3,5,0,1,7,0,1,2,3,7,2

How many page faults will occur if there are four free frames available and the FIFO page replacement algorithm is used? Briefly explain.
Twelve-page faults will occur. Suppose the first reference(i.e. 9) causes page faults one after the other rand pages are loaded into free frames 1,2 and 3 respectively. Now the next reference (i.e 2) causes a page fault. In this case, page 9 is removed from frame 0, and the page 2is loaded into it. This is because page 9 was loaded first. After reference 2, the next reference is 3, no page fault will occur for this reference because it is already in memory. This process continues.

What is Belady's Anomaly in the FIFO page replacement algorithm?

In the FIFO page replacement algorithm, increasing the number of frames increases the number of page faults for the same reference string. This is called Belady's Anomaly.

What is the LRU  page replacement algorithm?

The LRU page replacement algorithm selects the page for removal that has not been used for the longest period of time. The LRU algorithm associated with each page the time of last use of that page. 

Define the NRU algorithm?

The NRU (Not Recently Used) algorithm is used to select a page for removal that is used recently and not likely to be used in near future. The NRU is an approximation of LRU.

Briefly describe the Second Chance algorithm?

The Second Chance algorithm is the combination of the FIFO and NRU algorithms. This algorithm is also said to be a Clock algorithm. This algorithm is used to given a second chance to a page for execution that has been loaded in the main memory for the longest time. After giving the second chance, the page is removed from the main memory. 

Describe the Optimal Page Replacement algorithm and its main advantages?

The Optimal Replacement algorithm replaces the page that is not used for the longest period of time in virtual memory. An Optimal Page Replacement algorithm produces the lowest page-fault rate in virtual memory.

What is meant by the working set?

A working set is a collection of pages of a process that are actively referenced by a process at a particular time. The working set of a process must be maintained in main memory for the efficient execution of the process, otherwise, thrashing may occur repeatedly.

What is Thrashing and how can it be controlled?

In multiprogramming environments, pages of processes are continuously swapped out and swapped in. Sometimes a situation arises when CPU consumers more time in swapped of pages than actually executing the process. Such a situation is called Thrashing.
Thrashing can be controlled by using a local replacement algorithm. In most cases, the operating system attempts to recover from thrashing by suspending the execution of some processes and preventing to load of new processes.

If the program size is larger than the available main memory in a system, then which technique is used to execute the program?

The virtual Memory technique is used to execute the program

Which technique is used to implement virtual memory?

Demand Paging technique is used to implement virtual memory

Which technique has the combined features of simple paging and overlaying?

Demand Paging technique has the combined features of simple  paging and overlaying

Which statement is not true about demand paging?

With demand paging, all pages of the program are loaded into memory at once before the execution of the program.

When does a page fault trap occur?

  1. If a process tries to access a page and the page is not in memory.
  2. If the page table has in/out a bit as "out"

The page replacement technique is implemented by using:

1. Modify bit in the page table
2. Dirty bit in the page table

If the dirty bit for a page is set by the hardware, it indicates that the page is:

Modified

Which is not a page replacement algorithm?

Third Chance is not a page replacement algorithm.

Which page replacement algorithm is used to select the page that has been resident in memory for the longest time?

FIFO page replacement algorithm is used to select the page.

Which page replacement algorithm is used to select the page that has been unused for the longest time?

LRU page replacement algorithm is used.

Which algorithms are also known as the clock algorithm?

Second Chance algorithms are also known as the clock algorithm.


Comments

Popular posts from this blog

Modern scenario of information technology:

Deadlock Questions and Answers pdf

What is the bus interconnection?