Locality of reference implies that the page reference being made by a process
View worked solution
Answer: B
Locality of reference (also known as the principle of locality) is the tendency of a processor to access the same set of memory locations repeatedly over a short period of time. It is broadly classified into two types:
- Temporal Locality: If a particular memory location is referenced, it is highly likely to be referenced again in the near future (e.g., loop variables, instructions inside a loop).
- Spatial Locality: If a particular memory location is referenced, nearby memory locations are likely to be referenced in the near future (e.g., sequential execution of code, traversing an array).
Let's evaluate the given options:
- Option A: "will always be to the page used in the previous page reference" — Incorrect. While it is likely to access the same page, it is not guaranteed ("always") to be the exact same page.
- Option B: "is likely to be to one of the pages used in the last few page references" — Correct. This is the definition of temporal locality, indicating a high probability of accessing recently used pages.
- Option C: "will always be to one of the pages existing in memory" — Incorrect. A process can reference a page that is currently on disk, resulting in a page fault.
- Option D: "will always lead to a page fault" — Incorrect. Locality of reference actually minimizes page faults when the working set of pages is loaded into physical memory.
Free practice · Your answers on this page are not saved.
