1,226 views

1 Answer

Best answer
1 votes
1 votes

There are basically two types of Demand Paging:

1. Pure Demand Paging

  • In this case, the pages are brought in the main memory only when required/demanded by the CPU. This technique increases the degree of multiprogramming, since we are bringing pages into main memory as and when required, so large number of processes can be present in main memory. 

2. Pre-Fetch Demand Paging

  • In this case, pages other than the required/demanded by the CPU are also brought in to memory. The OS guesses in advance which page the current process will require and pre-fetched and pre-loads them into the main memory. We can think this technique as using the idea of “Spatial Locality of Reference” which tries to minimize the near future faults and this reduces the overall process execution time.

Now, if the process is small in size i.e. say if a process requires only two pages, then Pre-Fetch Demand Paging can bring in both pages in main memory and hence the entire process is now in main memory.

So, we can say Demand paging can bring entire process into memory at load time. (At least one page of a process should be in main memory. If no page of a process is in main memory then it means process is not in ready state). So basically using Pre-Fetch Demand Paging technique instead loading the first page bring all pages of that process if the process size is to small.

selected by

Related questions

0 votes
0 votes
1 answer
2