Unix Memory Management question and answer for interview

15. What are the criteria for choosing a process for swapping out of the memory to the swap device?

  1. The process's memory resident time,
  2. Priority of the process and
  3. The nice value.

16. What do you mean by nice value?
Nice value is the value that controls {increments or decrements} the priority of the process. This value that is returned by the nice() system call. The equation for using nice value is:
Priority = ("recent CPU usage"/constant) + (base- priority) + (nice value)
Only the administrator can supply the nice value. The nice() system call works for the running process only. Nice value of one process cannot affect the nice value of the other process.

17. What is a Region?
A Region is a continuous area of a process's address space (such as text, data and stack). The kernel in a "Region Table" that is local to the process maintains region. Regions are sharable among the process.

18. What are the events done by the Kernel after a process is being swapped out from the main memory?
When Kernel swaps the process out of the primary memory, it performs the following:

  1. Kernel decrements the Reference Count of each region of the process. If the reference count becomes zero, swaps the region out of the main memory,
  2. Kernel allocates the space for the swapping process in the swap device,
  3. Kernel locks the other swapping process while the current swapping operation is going on,
  4. The Kernel saves the swap address of the region in the region table.

19. 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.

20. 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.

User Answer

  1. Be the first one to express your answer.

Unix Memory Management question and answer for interview