UNIX Memory Management - Interview Questions and Answers


  1. What are conditions on which deadlock can occur while swapping the processes?
    1. All processes in the main memory are asleep.
    2. All "ready-to-run" processes are swapped out.
    3. There is no space in the swap device for the new incoming process that are swapped out of the main memory.
    4. There is no space in the main memory for the new incoming process.
  2. What are conditions for a machine to support Demand Paging?
    1. Memory architecture must based on Pages,
    2. The machine must support the 'restartable' instructions.
  3. What is "the principle of locality"?
    It's the nature of the processes that they refer only to the small subset of the total data space of the process. i.e. the process frequently calls the same subroutines or executes the loop instructions.
  4. What is the working set of a process?
    The set of pages that are referred by the process in the last "n", references, where "n" is called the window of the working set of the process.
  5. What is the window of the working set of a process?
    The window of the working set of a process is the total number in which the process had referred the set of pages in the working set of the process.
  6. What is called a page fault?
    Page fault is referred to the situation when the process addresses a page in the working set of the process but the process fails to locate the page in the working set. And on a page fault the kernel updates the working set by reading the page from the secondary device.