Demand Paged Memory
Allocation : In the demand paged memory
allocation one programmer assumes infinite memory called
virtual memory. In which the Job operates under demand.
Paging virtual memory is large in size
then the available memory the demand paging allocation is shown in
figure.
In demand
pages memory allocation a particular page is swapped from the secondary storage
device if it is required for execution.
In the above fig. Job address space consists of
10,000B of programs called page and we have only 3000B of memory
available. This 10,000B program
run in 3000B of memory by using demand paging.
The page
map table consists of a page number, page frame number, status and
judgement field. Initially the
allocation algorithm places the first three pages of a program in the
main memory. The job starts execution in
one of these pages. Suppose in page O
there is a transfer instruction to the location 9055. The hard ware mechanism uses 9 as index
to the page lable that is page 9 is required in the execution. then the pagemap table is checked to find
whether the page in the main memory job not if the required page is not
in the main memory then the page fault occurs, then the hard ware
generates interrept to the operating system then the operating system
searches the secondary storage device for page 9 and brought into
the memory by replacing one of the pages in the memory It may use a page
remove algorithms like FIFO(First in first out) LRU(Least Recently Use)
for removing a page. The decision
which page has to replace it with judgement field in the page map
table. It is desirable to keep highly
used pages in the memory.
Advantages :
1.Fragmentation is eliminated.
2.Large Virtual memory is available.
3.More efficient use of memory.
4.Demand paging is valuable in time
sharing, systems.
Dis-Advantages :
1.Page address mapping hard ware increases
the cost of the computer system
2.Extra memory, extra register needed for
page map table.