Ch03 Virtual Memory Memory Management
Ch03 Virtual Memory Memory Management
Ch03 Virtual Memory Memory Management
Memory Management:
Virtual Memory
Fragmentation
contiguously
Eliminate the need for entire program to reside in
memory
Loads all of the program’s pages into them
number division
locations
Memory used more efficiently; more jobs can fit
Disadvantages:
Address resolution causes increased overhead
location
Size of page is crucial (not too small, not too large)
page boundaries)
Page fault: a failure to find a page in memory
schemes
Disadvantages:
Increased overhead caused by the tables and the
page interrupts
Page Requested: B A C A B D B A C D
Page Frame 1:
Page Frame 2:
Interrupt:
Time Snapshot:
Success Ratio: =
Failure Ratio: =
Success Ratio: =
Failure Ratio: =
Success Ratio: =
Failure Ratio: =
Success Ratio: =
Failure Ratio: =
swapped out
Modified bit: Indicates if page contents have been
altered
Used to determine if page must be rewritten to
Table 3.3: Page Map Table for Job 1 shown in Figure 3.5.
Topics:
1. Segmented Memory Allocation
2. Segmented/Demand Page Memory Allocation
Objectives:
After the discussion, the students should be able to:
Define segmented and segmented/page memory
allocation
Familiarize the architecture of segmented and
M=a*j;
printf(“\n%d %d %d”, j,k,m)
} Page 1
printf(“\n”);
An example of demand paging that causes a page swap each time the
loop is executed and results in thrashing. If only a single page frame
is available, this program will have one page fault each time the loop
is executed.
Understanding Operating Systems 48
, Fourth Edition
Segmented Memory Allocation
(cont.)
What is segmented memory allocation?
Each job is divided into several segments of
whole system)
Segment Map Table lists details about each
Disadvantages:
Difficulty managing variable-length segments in
secondary storage
External fragmentation
whole system)
Segment Map Table lists details about each
Disadvantages:
Table handling overhead
code
Determine what segments the line belong
Topics:
1. Virtual and Cache Memory
Objectives
After the discussion, the students should be able to:
Define virtual memory and cache memory
cache memory
Virtual memory
Main Memory
Main memory