A process cannot be loaded and has to keep waiting

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s and vary from one system to another. Now when a process is to be loaded into the memory, its pages are loaded into the free page frames wherever free page frames are available and a mapping table (called page table) is maintained by the operating system to keep track of which page of the process is loaded into which page frame of the memory. Atypical example to illustrate this is shown in Figure 14.15. Notice from the figure that the page frames allocated to the pages of the process need not be contiguous. To ensure correct memory addressing, in case of paging every address generated by the CPU is divided into two parts consisting of a page number and a page offset. The page table is used to obtain the corresponding page frame number from the page number, and the page offset is added to the base address of the page frame number to define the physical memory address that is sent to the memory unit. Notice that there is no external fragmentation problem in a system that uses the paging scheme because free pa frames allocated to a process can be anywhere in the memory (need not be contiguous). However, the paging scheme leads to some unutilized memory space due to internal fragmentation because the unit of memory allocation is a page frame. If the memory requirements of a process do not happen to fall on page boundaries, the last page frame allocated to the process will not be completely full. For example, if the page size used is 2048 bytes, and a process's memory requirement is 23,548 bytes, the process will need 11 pages plus 1020 bytes. As the unit of memory allocation is a page frame, the process will be allocated 12 page frames, resulting in an internal fragmentation of 2048 - 1020 = 1028 bytes. On an average, internal fragmentation leads to wastage of one-half page per process in case of paging scheme. Hence, the larger is the page size, the larger will be the memory wastage due to internal fragmentation. This suggests the use of small page sizes. However, the smaller the page size, the larger will be the page tables and the overhead involved in maintaining them. Hence these two...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online