天天看点

Paging memory management

Paging memory management

  1. The main memory is divided into a number of units called frames.
  2. Processes are divided into fixed sized units called pages.
  3. The size of each page is same as that of each frame.
  4. A frame is used to load a page.
  5. The pages of a process/program might be scattered throughout the available frames(may or may not in contiguous frames).
  6. A page-frame table/page-map table is used to record which pages are loaded into which frames.
  7. The logic address of a program instruction is expressed as (PageNumber, offset)
  8. The physical address of a program instruction can be gotten by adding the offset to the star address of a page frame.
  9. Not all the pages of a process need to be loaded to start execution. There might be insufficient page frames available for the whole process.
  10. This leads to the use of virtual memory.
  11. Since not all the pages of a process are loaded into frames, as the running of the process, the instruction of the pages that are not loaded into frames might be needed. But it is possible that there are no frames available. When this happens a page in a frame must be swapped out to the secondary storage so that the frame is available to load the required page. This is called page swapping
  12. This may give rise of another question: disk thrashing. Too much page swapping will lead to a degradation in performance. If this happens, the memory manager spends almost all of its time swapping pages in and out of memory and little time in the execution of the process.

继续阅读