Related Content: CS604 - VU Lectures, Handouts, PPT Slides, Assignments, Quizzes, Papers & Books of Operating Systems
This is the generalization of the fixed partition scheme. It is used primarily in a batch environment. This scheme of memory management was first introduced in IBM OS/MVT (multiprogramming with a varying number of tasks). Here are the main characteristics of MVT.
As processes come and go, holes of free space are created in the main memory. External Fragmentation refers to the situation when free memory space exists to load a process in the memory but the space is not contiguous. Compaction eliminates external fragmentation by shuffling memory contents (processes) to place all free memory into one large block. The cost of compaction is slower execution of processes as compaction takes place.
In the memory management techniques discussed so far, two Paging is a memory
management scheme that permits the physical address space of a process to be noncontiguous.
It avoids the considerable problem of fitting the various sized memory
chunks onto the backing store, from which most of the previous memory-management
schemes suffered. When some code fragments or data residing in main memory need to
be swapped out, space must be found on the backing store. The fragmentation problems
discussed in connection with main memory are also prevalent with backing store, except
that access is much slower so compaction is impossible.
Physical memory is broken down into fixed-sized blocks, called frames, and logical
memory is divided into blocks of the same size, called pages. The size of a page is a
power of 2, the typical page table size lying between 1K and16K. It is important to keep
track of all free frames. In order to run a program of size n pages, we find n free frames
and load program pages into these frames. In order to keep track of a program’s pages in
the main memory a page table is used.
Thus when a process is to be executed, its pages are loaded into any available memory frames from the backing store. The following snapshots show process address space with pages (i.e., logical address space), physical address space with frames, loading of paging into frames, and storing mapping of pages into frames in a page table.
Mapping paging in the logical into the frames in the physical address space and keeping this mapping in the page table
Every logical address generated by the CPU is divided into two parts: a page number (p) and a page offset (d). The page table contains the base address (frame number) of each page in physical memory. The frame number is combined with the page offset to obtain the physical memory address of the memory location that contains the object addressed by the corresponding logical address. Here p is used to index the process page table; page table entry contains the frame number, f, where page p is loaded. The physical address of the location referenced by (p,d) is computed by appending d at the end of f, as shown below:
The hardware support needed for this address translation is shown below.
Paging itself is a form of dynamic relocation. When we use a paging scheme, we have no external fragmentation; however we may have internal fragmentation. An important aspect of paging is the clear separation between the user’s view of memory and the actual physical memory. The user views that memory as one single contiguous space, containing only this program. In fact, the user program is scattered throughout the physical memory, which also holds other programs.