⇰ PAGING :-
In Operation System, paging is actually a memory management scheme that eliminates the need for contiguous memory allocation. It permits the physical address space of a process to be non–contiguous type.
In Operation System, paging is actually a memory management scheme that eliminates the need for contiguous memory allocation. It permits the physical address space of a process to be non–contiguous type.
Paging also solves the considerable problem of fitting memory chunks of varying sizes onto the backing store. Most memory management schemes before the introduction of paging suffered from this problem. The problem arises because, when data residing in main memory need to be swapped out, space must be found on the backing store. The backing store has the same fragmentation problems. However, paging avoids external fragmentation
The basic method for implementing paging involves breaking physical memory or main memory into fixed-sized blocks called frames and breaking logical memory or secondary memory ( Harddisk) into blocks of the same size called pages. And the size of a frame is kept the same as that of a page to have optimum utilization of the main memory and to avoid external fragmentation. When a process is to be executed, its pages are loaded into any available memory frames in main memory.
One page of the process is to be stored in one of the frames of the memory. The pages can be stored at the different locations of the memory but the priority is always to find the contiguous frames or holes. Pages of the process are brought into the main memory only when they are required otherwise they reside in the secondary storage.
Different operating system defines different frame sizes. The sizes of each frame must be equal. Considering the fact that the pages are mapped to the frames in Paging, page size needs to be as same as frame size. A computer can address more memory than the amount physically installed on the system. This extra memory is actually called virtual memory and paging technique plays an important role in implementing virtual memory.
Because of its advantages over earlier methods, paging in its various forms is used in most operating systems, from those for mainframes through those for smartphones. Paging is implemented through cooperation between the operating system and the computer hardware.
⇰ EXAMPLE OF PAGING :-
Suppose our main memory size is 16 KB and the the frame size is 1 KB. Therefore, the main memory is divided into 16 frames of 1 KB each. Each process present in secondary memory will be divided into pages of 1 KB each. Let there are 4 processes P1, P2, P3 and P4 of 4 Kb each. Each process is divided into pages of 1 KB each, so that one page can be stored in one frame.
Since initially all the frames are empty so pages of processes will get stored in the contigeous way as follows:-
Now assume that P2 and P4 are moved to waiting state, so now 8 frames are empty and can be alloted to other process. Suppose a process P5 of 8 KB is waiting in ready queue, now this process can be loaded at the place of P2 and P4 as :-
Share, Follow and please comment if you find anything incorrect or to share more information about the topic discussed above
Comments
Post a Comment
Please comment.