Paging

                                    paging

                                A computer can address more memory than the amount physically installed on the system. This extra memory is actually called virtual memory and it is a section of a hard that's set up to emulate the computer's RAM. Paging technique plays an important role in implementing virtual memory.

                                 Paging is a memory management technique in which process address space is broken into blocks of the same size called pages (size is power of 2, between 512 bytes and 8192 bytes). The size of the process is measured in the number of pages.


Demand paging Preliminaries:

                                    In demand paging, a page is loaded in memory when needed, i.e., when a logical address generated by a process points to a page that is not present in memory. When the virtual memory handler decides to remove a page from memory, the page is copied back into the swap space if it was modified since the last time it was loaded in memory. This way the swap space contains an up-to-date copy of every page that is not present in memory.

                                   Demand paging involves interaction between hardware and software components of the virtual memory, i.e., between the MMU and the virtual memory handler.

                                   There are three concepts are important in understanding operation of demand paging. These are:

  •   Page faults(also called missing page interrupts)
  •  Page-in and page-out operations.
  •  Page replacement.


What is Page Fault?

                        If the referred page is not present in the main memory then there will be a miss and the concept is called Page miss or page fault.

                  The CPU has to access the missed page from the secondary memory. If the number of page fault is very high then the effective access time of the system will become very high.

Advantages of Paging:

Here is a list of advantages and disadvantages of paging −

  • Paging reduces external fragmentation, but still suffer from internal fragmentation.
  • Paging is simple to implement and assumed as an efficient memory management technique.
  • Due to equal size of the pages and frames, swapping becomes very easy.

Disadvantages of Paging:

  • Page table requires extra memory space, so may not be good for a system having small RAM.