Chapter 3 Flashcards
What is Paged Memory Allocation?
The concept of dividing jobs into units of equal size and each unit is called a page.
What is a page frame in Paged Memory Allocation?
A section of main memory that is the exact same size as the page chosen.
Outline the role of Memory Manager in a Paged Memory Allocation.
Before executing a program, a basic Memory Manager prepares it by:
1. Determining the number of pages in the program
2. Locating enough empty page frames in main memory
3. Loading all of the program’s pages into those frames
What are the advantages of Paged Memory Allocation?
- The pages do not have to be loaded in adjacent memory blocks
- Because of storing programs non-contiguously main memory is used more efficiently because an empty page frame can be used by any page of any job.
- There is no external fragmentation between page frames
What are the disadvantages of Paged Memory Allocation?
- Overhead is increased
- Internal Fragmentation is still a problem
- Entire job is loaded into memory.
- The key to success of this scheme is the size of the page
How does the Memory Manager keep track of jobs’ pages?
Memory Manager uses tables to keep track of them:
1. Job Table
2. Page Map Table
3. Memory Map Table
Outline what the Job Table stores in Paged Memory Allocation?
- Contains two values for each active job: the
size of the job and the memory location where its Page Map Table is stored - The Job Table is a dynamic list that grows as jobs are loaded into the system and shrinks, as they are later completed.
Outline what the Page Map Table stores in Paged Memory Allocation?
Contains the vital information for each page:
1. The page number and its corresponding memory address of the page frame
Outline what the Memory Map Table stores in Paged Memory Allocation?
Has one entry for each page frame and shows its location and its free/busy status.
What is displacement in Paged Memory Allocation?
How far away a certain byte is from the beginning of its page frame. The operating system can access the correct bytes by using its relative position from the beginning of its page frame.
What is the algorithm to calculate the
page and displacement ?
BYTE_NUMBER_TO_BE_LOCATED / PAGE_SIZE = PAGE_NUMBER
Outline the steps of address resolution to find the exact memory location in Paged Memory Allocation?
- Do arithmetic computation to determine page number and displacement.
- Refer to PMT and find out which page frame contains page calculated
- Get the address of the beginning of the page frame
- Add displacement to starting address of page frame identified
What is Demand Paging Memory Allocation?
With demand paging, jobs are still divided into equally-sized pages that initially reside in secondary storage. When the job begins to run, its pages are brought into memory only as they are needed, and if they’re never needed, they’re never loaded.
Outline the role of Memory Manager in Demand Paging Memory Allocation
Before executing a program, a basic Memory Manager prepares it by:
1. Determining the pages needed in memory to execute program
2. Locating enough empty page frames in main memory, swapping if needed.
3. Updating the three tables after swaps
What are the advantages of Demand Paging Memory Allocation?
- The demand paging scheme allows the user to run jobs with less main memory than is required.
- Quick data retrieval between secondary storage and main memory because of DASDs (direct access storage devices)
What are the disadvantages of Demand Paging Memory Allocation?
- Thrashing
- Scheme is most efficient when programmers are aware of the page size used by their operating system and are careful to design their programs to keep page faults to a minimum
What three new fields are added to the PMT in Demand Paging Memory Allocation? Detail their usage.
- Status field - to determine if the page being requested is already in memory
- Modified field - to determine if the page contents have been modified while in memory
- Referenced field - to determine if the page has been referenced most recently
How does the three added field in PMT benefit Demand Paging Memory Allocation?
- Status field - spares the system time to bring page from secondary storage as a table is quicker to scan.
- Modified field - used to save time when pages are removed from main memory and returned to secondary storage. If the contents of the page haven’t been modified, then the page doesn’t need to be rewritten to secondary storage.
- Reference Field - used to determine which pages show the most processing activity and which are relatively inactive. This information is used by several page-swapping policy schemes to determine which pages should remain in main memory
What is swapping in Demand Paging Memory Allocation?
Moving in a new page if no empty page frames are available. One of the resident pages must be swapped back into secondary storage.