Demand paging デマンドページング

Demand paging (as opposed to anticipatory paging) is an application of virtual memory.

 This is an example of lazy loading techniques.



Demand paging, as opposed to loading all pages immediately:

  • Only loads pages that are demanded by the executing process. 
  • 只載入需要的頁
  • As there is more space in main memory, more processes can be loaded reducing context switching time which utilizes large amounts of resources.
  • 利用率更高,更多的進程可以有效利用內存
  • Less loading latency occurs at program startup, as less information is accessed from secondary storage and less information is brought into main memory.
  • 初次載入的內容較少,延遲也會較小


  • Individual programs face extra latency when they access a page for the first time. So demand paging may have lower performance thananticipatory paging algorithms.
  • 對單獨一個程序來說,機制本身產生了延遲開銷
  • Programs running on low-cost, low-power embedded systems may not have a memory management unit that supports page replacement.
  • 需要MMU來支持
  • Memory management with page replacement algorithms becomes slightly more complex.
  • 換入換出算法複雜
  • Possible security risks, including vulnerability to timing attacks; see Percival 2005 Cache Missing for Fun and Profit (specifically the virtual memory attack in section 2).
  • 會被玩弄- -?
  1. indefiniteseven posted this