Module 4 Flashcards
It is a technique that allows the execution of processes that may not be completely in memory.
Virtual Memory
True or Flase
In Virtual Memory, programs can be larger than physical memory.
True
Virtual Memory _________ main memory into a large uniform array of storage.
Abstracts
Virtual Memory ___________ logical memory from physical memory and allows users to have a large virtual memory with a small physical memory.
Separates
True or False
Virtual Memory frees the concerns of memory storage limitations.
True
True or False
In Virtual Memory, multiple programs do not need to be in main memory at the same time.
True
What are the benefits of Virtual Memory?
- A program would no longer be constrained by the amount of physical memory available.
- More programs could run at the same time.
- Less I/O is needed to load or swap each program into memory (i.e. it runs faster).
This system is similar to a paging system with swapping.
Demand-Paging System
This is when the OS or pager swaps only the necessary pages into memory.
Lazy Swapping
In Demand-Paging, there is an additional bit in the page table which is the __________.
Valid-Invalid Bit
It is when the page is in memory/primary memory.
Valid Bit
It is when the page is in secondary storage.
Invalid Bit
Using a page not in physical memory will result in a __________.
Page-Fault
This will cause a trap indicating an invalid address error.
Page-Fault
Steps in Handling Page-Fault:
Step 1: The system could start executing a process with no pages in memory in extreme
cases. It would immediately fault for the page with the first instruction.
Step 2: After the first page is brought into memory, the process would continue to execute,
faulting as necessary until every page that it needed was actually in memory.
Step 3: This is pure demand paging: never bring a page into memory until it is required.
Step 4: The principle of locality of reference ensures that programs do not access a new
page of memory with each instruction execution.
Step 5: The effectiveness of the demand paging is based on the locality of reference.
Step 6: Analysis of programs shows that most of their execution time is spent on routines in
which many instructions are executed repeatedly.
Step 7: It is important to keep the page-fault rate low in a demand-paging system. Otherwise,
the effective access time increases, slowing down process execution dramatically.
Step 8: A problem occurs if there is a need to transfer a page from disk to memory but there is
no memory space or free frames available. In other words, memory is over-allocated.
What step is this in handling Page-Fault?
The system could start executing a process with no pages in memory in extreme
cases. It would immediately fault for the page with the first instruction.
Step 1
What step is this in handling Page-Fault?
After the first page is brought into memory, the process would continue to execute,
faulting as necessary until every page that it needed was actually in memory.
Step 2
What step is this in handling Page-Fault?
This is pure demand paging: never bring a page into memory until it is required.
Step 3
What step is this in handling Page-Fault?
The principle of locality of reference ensures that programs do not access a new
page of memory with each instruction execution.
Step 4
What step is this in handling Page-Fault?
It is important to keep the page-fault rate low in a demand-paging system. Otherwise,
the effective access time increases, slowing down process execution dramatically.
Step 7
What step is this in handling Page-Fault?
Analysis of programs shows that most of their execution time is spent on routines in
which many instructions are executed repeatedly.
Step 6
What step is this in handling Page-Fault?
A problem occurs if there is a need to transfer a page from disk to memory but there is
no memory space or free frames available. In other words, memory is over-allocated.
Step 8
How many steps are there in handling Page-Fault?
8 Steps
True or False
The operating system could terminate the user process. However, demand paging is the operating system’s attempt to improve the computer system’s utilization and throughput.
True
True or False
Users should not be aware their processes are running on a paged system; paging should be logically transparent to the user.
True
In this scheme, the operating system removes or replaces one of the existing pages in memory to give way for the incoming page.
Page Replacement
This algorithm is used to select which pages in memory will be replaced.
Page Replacement Algorithm
Page Replacement takes the following approach:
- If no frame is free, the system finds one that is currently being used and frees it.
- Freeing a frame means transferring its contents to the disk and changing the page table (and all other tables) to indicate that the page is no longer in memory.
True or False
In Page Replacement, if no frame is free, the system finds one that is currently being used and frees it.
True
True or False
In Page Replacement, freeing a frame means transferring its contents to the disk and changing the page table (and all other tables) to indicate that the page is no longer in memory.
True
True or False
The Page Fault Service Routine is now modified to include Page Replacement.
True
What are the steps of Page Fault Service Routine?
- Find the location of the desired page on the disk.
- Find a free frame
- If there is a free frame, use it.
- Otherwise, use a page-replacement algorithm to select a victim frame.
- Write the victim page to the disk; change the page and frame tables accordingly.
- Read the desired page into the newly free frame; change the page and frame tables.
- Restart the user process.
What step is this in the Page Fault Service Routine?
Find the location of the desired page on the disk.
Step 1
What step is this in the Page Fault Service Routine?
Find a free frame
Step 2
What step is this in the Page Fault Service Routine?
If there is a free frame, use it.
Step 3
What step is this in the Page Fault Service Routine?
Otherwise, use a page-replacement algorithm to select a victim frame.
Step 4
What step is this in the Page Fault Service Routine?
Write the victim page to the disk; change the page and frame tables accordingly.
Step 5
What step is this in the Page Fault Service Routine?
Read the desired page into the newly free frame; change the page and frame tables.
Step 6
What step is this in the Page Fault Service Routine?
Restart the user process.
Step 7
How many steps are there in the Page Fault Service Routine?
7 Steps
In Page Replacement, if no frames are free, how many page transfers are required?
Two page transfers (one out and one in)
True or False
In Page Replacement, two page transfers doubles the Page-Fault Service time and increases the effective access time accordingly.
True
To reduce overhead, __________ is necessary for each page or frame.
Modify Bit or Dirty Bit
This bit is set when a byte is written into to indicate that the page has been modified.
Modify Bit
True or False
An incoming page can overwrite an unchanged page whose modify bit is 0.
True
These are techniques which an OS decides which memory pages to swap out, write to disk when a page of memory need to be allocated.
Page Replacement Algorithms
A good Page-Replacement algorithm is one with __________.
Low Page-Fault rate
An algorithm is evaluated by running it on a particular _____________ and computing the number of page faults.
Reference String
It is the simplest page-replacement algorithm; the oldest page is used to replace a page.
First-In First-Out (FIFO/Queue) Algorithm
In this algorithm, it is not necessary to record the time when a page is brought in.
FIFO Algorithm
True or False
In FIFO Algorithm, the head of the queue is replaced if a frame is needed and brought into memory at the tail of the queue.
True
True or False
FIFO Algorithm performance is not always good.
True
True or False
In FIFO Algorithm, even if the algorithm selects for replacement a page that is in active use, everything still works correctly.
True
In FIFO Algorithm, a _______ increases the page-fault rate and slow process execution, but does not cause incorrect execution.
Bad replacement choice
The ______________ in physical memory, the lower the page-fault rate.
More frames available
It is the instance where the page-fault rate increases as the number of physical memory frames increases.
Belady’s Anomaly
This algorithm has the lowest page-fault rate of all algorithms.
Optimal Algorithm
In Optimal Algorithm, the ___________ is the one that will not be used for the longest period of time.
Page replaced
True or False
In Optimal Algorithm, if the first three page-faults are ignored, the algorithm is twice as good as FIFO Algorithm.
True
This algorithm is difficult to implement since it requires future knowledge of the reference string.
Optimal Algorithm
This algorithm is used mainly for comparison studies.
Optimal Algorithm
This algorithm uses the recent pas to approximate the near future.
Least Recently Used (LRU) Algorithm
This algorithm, similar to the Optimal Algorithm, replaces the page that has not been used for the longest period of time.
Least Recently Used (LRU) Algorithm
The ________ is often used as a page replacement algorithm and is considered to be quite good.
LRU policy
True of False
A major problem in LRU Algorithm is how to implement the LRU replacement.
True