Demand Paging Article Index for
Demand
Website Links For
Demand
 

Information About

Demand Paging





ADVANTAGES OF DEMAND PAGING


  • Does not load the pages that are never accessed, so saves the memory for other programs and increases the degree of multiprogramming.

  • Less loading latency at the program startup.

  • Less disk overhead because of fewer page reads.

  • Pages will be shared by multiple programs until they are modified by one of them, so a technique called Copy On Write will be used to save more resources.

  • Ability to run large programs on the machine, even though it does not have sufficient memory to run the program. This method is better than an old technique called Overlays .

  • Does not need extra hardware support than what paging needs, since protection fault can be used to get page fault.



DISADVANTAGES


  • Individual programs face extra latency when they access a page for the first time. So Prepaging , a method of remembering which pages a process used when it last executed and preloading a few of them, is used to improve performance.

  • Memory management with Page Replacement Algorithms becomes slightly more complex.

  • Possible security risks, including vulnerability to Timing Attack s; see Percival 2005 Cache Missing for Fun and Profit (specifically the virtual memory attack in the first section).


In Unix systems such as Linux , demand paging is accomplished
by the means of the Mmap() system call. It is also used when
executing new programs. The operating system Maps the
executable file (and its dependent libraries) into the address space
of the newly executing program, without actually allocating any physical
RAM for the contents of those files.
When the mappings are read-only and Shared , the program may actually run literally from the Page Cache .


SEE ALSO




REFERENCES


  • Tanenbaum, Andrew S. ''Operating Systems: Design and Implementation (Second Edition)''. New Jersey: Prentice-Hall 1997.