Interview Questions - UNIX Memory Management

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

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

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.