All Exams Test series for 1 year @ ₹349 only
Question

With__________, a page is written out to secondary memory only when it has been selected for replacement.

The correct answer is

Demand cleaning

Understanding Page Management and Cleaning

In operating systems, memory management techniques like virtual memory allow a system to use secondary storage (like a hard disk) as an extension of primary memory (RAM). Data is moved between RAM and the disk in fixed-size blocks called pages.

When a page in RAM is modified, it becomes 'dirty'. Before this page can be replaced by a new page from disk, the dirty page's contents must be written back to the secondary storage to ensure data consistency. This process of writing a dirty page back to secondary storage is often referred to as 'cleaning' the page.

Page Cleaning Strategies

There are different strategies for when a dirty page is written back to secondary memory. The question describes a specific strategy where this write-back occurs only at the moment a page is chosen to be evicted from primary memory to make space for another page. Let's look at the options provided:

  • Fast cleaning: This term is not standard terminology in operating system memory management regarding page write-backs.
  • Secondary cleaning: This term is not standard terminology in operating system memory management regarding page write-backs.
  • Pre-cleaning: This strategy typically involves writing dirty pages back to disk periodically or proactively in anticipation of future page replacements, rather than waiting until the last possible moment. This can help reduce the latency when a page fault occurs and a clean page is needed immediately for replacement.
  • Demand cleaning: This strategy defers writing dirty pages back to secondary memory until the page is actually selected for replacement. This is an 'on-demand' approach. The page is only cleaned when the demand for a free frame necessitates its removal and write-back. This aligns precisely with the description in the question: "a page is written out to secondary memory only when it has been selected for replacement."

Analyzing the Correct Approach: Demand Cleaning

Based on the analysis of the cleaning strategies, the term that matches the description "a page is written out to secondary memory only when it has been selected for replacement" is Demand cleaning.

Demand cleaning has the advantage of potentially avoiding unnecessary writes if a dirty page is modified multiple times before it is replaced. Only the final version needs to be written back. However, it can potentially increase the time taken to handle a page fault because if the selected page is dirty, the system must wait for the write operation to complete before the new page can be loaded into the freed frame.

Comparison of Cleaning Strategies
Strategy When Cleaning Occurs Potential Advantages Potential Disadvantages
Pre-cleaning Periodically or proactively Reduces page fault handling time if the selected page is already clean. May write pages that are modified again shortly after cleaning.
Demand cleaning Only when page is selected for replacement Avoids unnecessary writes for pages modified multiple times before replacement. Increases page fault handling time if the selected page is dirty.

Revision Table: Memory Page Management

  • Virtual Memory: Technique using disk as an extension of RAM.
  • Page: Fixed-size block of data moved between RAM and disk.
  • Dirty Page: A page in RAM that has been modified.
  • Cleaning: Writing a dirty page back to secondary storage.
  • Demand Cleaning: Cleaning occurs only when the page is selected for replacement.

Additional Information: Page Replacement Policies

The cleaning strategy works in conjunction with a page replacement policy, which decides which page to remove from primary memory when a new page needs to be loaded. Common page replacement policies include:

  • First-In, First-Out (FIFO)
  • Least Recently Used (LRU)
  • Optimal Page Replacement (OPT) - theoretical

Regardless of the replacement policy used, if the chosen page is dirty, it needs to be cleaned before the frame can be reused, unless a specific cleaning strategy like demand cleaning or pre-cleaning is in place.

Was this answer helpful?

Important Questions from Operating Systems

  1. Windows 10 is

    A. an utility software

    B. a browser

    C. an application software

    D. an operating system
  2. What is ‘UBUNTU’?

  3. __________ provides an interface between a process and operating system to allow user-level processes to request services of the operating system.

  4. Which of the following is NOT a type of system software?

  5. The INF file processing functions provide setup and installation functionality that includes which of the following actions?

    1. Opening and closing an INF file

    2. Retrieving information about an INF file

    3. Retrieving information about source files and target directories for copy operations

    4. Performing the installation actions specified in an INF file section

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App