What is Paging?

Paging :

  • Paging is a memory management scheme that eliminates the need for contiguous allocation of physical memory.
  • Paging avoids external fragmentation and the need for compaction, whereas segmentation does not.
  • It involves breaking physical memory into fixed-sized blocks called frames and breaking logical memory into blocks of the same size called pages.
  • When a process is to be executed, its pages are loaded into any available memory frames from their source (a file system or the backing store). The backing store is divided into fixed-sized blocks that are the same size as the memory frames or clusters of multiple frames.
  • Every address generated by the CPU is divided into two parts: a page number (p) and a page offset (d).
  • The page number is used as an index into a page table. The page table contains the base address of each page in physical memory. This base address is combined with the page offset to define the physical memory address that is sent to the memory unit.
  • When we use a paging scheme,we have no external fragmentation, any free frame can be allocated to a process that needs it. However, we may have some internal fragmentation.
  • No. of frames=Physical Address Space/ Frame SizeNo. of pages=Logical Address Space/ Page Size
  • If logical address is of m bits, then Logical Address Space is of 2m words or bytes, if page size is of 2words or bytes, then No. of pages= 2m-n.

memory paging

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *