Anonymous user menu

demand paged memory system

operating system:

For a certain page trace starting with no page in memory a demand paged memory system operated under the LRU policy results in 9 and 11 page faults. When the primary memory is of 6 and 4 pages, respectively. When the same page trace is operated under the optimal policy, the number of page faults may be:

a) 9 and 7

b)7 and 9

c)10 and 12

d)6 and 7

please explain

2Comments
Ranita Biswas @ranita
9 Dec 2014 05:41 pm

Ans: (b) 7 and 9

The LRU scheme results in 9 and 11 page faults for memory sizes of 6 and 4 pages, respectively. Hence, the optimal (OPT) scheme must have a and b number of page faults for a memory size of 6 and 4 pages, respectively, where a ≤ 9 and b ≤ 11 and 0 ≤ a ≤ b. This is because OPT must be at least as good as LRU and must not have more faults if there is more memory. Initially, the memory is empty, and, hence, in both cases, there must be an initial set of accesses requiring more than the total number of pages of memory in order to cause page faults greater than the number of memory pages. Thus, even with OPT, there must be at least a number of page faults greater than the number of pages of memory for each memory size, that is a > 6 and b > 4. Hence, 6 < a ≤ 9 and 4 < b ≤ 11. Therefore, it should be noted that neither OPT nor LRU scheme suffers from Belady's anomaly.

jayendra @jayendra
9 Dec 2014 10:19 pm

thank you