Before a job is loaded into memory, it is divided into parts called _____ that will be loaded into memory locations called _____________
pages, page frames.
_____________ is based on the concept of dividing each incoming job into pages of equal size.
Paged memory allocation
The sections of a disk are called ______ (or sometimes blocks), and the sections of main memory are called __________.
sectors, page frames
Before executing a program, the Memory Manager prepares it by:
Primary advantage of storing programs in noncontiguous location (paged memory allocation):
The main memory is used more efficiently because an empty page frame can be used by any page of any job.
In addition, the compaction scheme used for relocatable partitions is eliminated because there is no external fragmentation between page frames (and no internal fragmentation in most pages).
Disadvantage of storing programs in noncontiguous location (paged memory allocation):
A job’s pages can be located anywhere in main memory, the Memory Manager now needs a mechanism to keep track of them—and that means enlarging the size and complexity of the operating system software, which increases overhead.
What tables does the Memory Manager use to keep track of jobs, pages, and memory locations in paged memory allocation?
Job Table contains two values for each active job:
What is displacement or offset?
The factor used to locate that byte within its page frame. It is a relative factor
Contains two values for each active job: the size of the job (shown on the left) and the memory location where its Page Map Table is stored (on the right)
Job Table
Contains the vital information for each page—the page number and its corresponding page frame memory address.
Page Map Table
Has one entry for each page frame listing its location and free/busy status.
Memory Map Table
Formula for finding the address of a given program instruction:
The byte number is divided by the page size, keeping the remainder as an integer. The resulting quotient is the page number, and the remainder is the displacement within that page
Formula for finding the exact location in memory:
ADDR_PAGE_FRAME = PAGE_FRAME_NUM * PAGE_SIZE
INSTR_ADDR_IN_MEM = ADDR_PAGE_FRAME + DISPL
Every time an instruction is executed, or a data value is used, the operating system (or the hardware) must translate the job space address, which is relative, into its physical address, which is absolute.
This is called resolving the address, also called:
address resolution
Advantages and disadvantages of paging scheme:
Advantages:
- it allows jobs to be allocated in noncontiguous memory locations so that memory is used more efficiently
- more jobs can fit in the main memory
Disadvantages:
- overhead is increased
- internal fragmentation is still a problem
The concept of loading only a part of the program into memory for processing
Demand paging
It was the first widely used scheme that removed the restriction of having the entire job in memory from the beginning to the end of its processing
Demand paging
One of the most important innovations of demand paging was that it made ____________ feasible
virtual memory
The key to the successful implementation of demand paging is the use of a ____________________________
high-speed direct access storage device (such as hard drives or flash memory) that can work directly with the CPU
It determines whether there are empty page frames in memory so the requested page can be immediately copied from secondary storage.
If all page frames are busy, the ____________ must decide which page will be swapped out. Then the swap is made
page fault handler
When there is an excessive amount of page swapping between main memory and secondary storage, the operation becomes inefficient. This phenomenon
is called ________
thrashing
A failure to find a page in memory is often called a __________
page fault
the policy that selects the page to be removed
page replacement policy