Upload
florence-angela-boyd
View
270
Download
3
Tags:
Embed Size (px)
Citation preview
Memory Management
What if pgm mem > main mem ?
Memory Management
What if pgm mem > main mem ?
Overlays – program controlled
Memory Management
What if pgm mem > main mem ?
Virtual Memory – OS controlled (with architecture help)
Memory Management
Separate physical, logical address space
Page faults
Demand paging
Memory Access in VM
Is access legal ? (seg fault) If page in physical memory, return mem Else
Find free page Schedule disk operation Perform disk operation Update page table Restart program at offending address
Memory Access Time
Assume machine characteristics 200ns clock rate Main Mem access of 5 cycles 1000ns 25 milisecond page service time
Computing Average Access Time
MAT = (1 – p) * 1000 + p * 25,000,000
e.g. assume page fault rate of .001
MAT = .999 * 1000 + .001 * 25,000,000 = 999 + 25,000 26x penalty
Your Turn
Those were 1998 numbers Assume 2x speedup in clock speed every two
years, 2x speedup in disk access time every 4 years
What penalty would .001 page fault rate lead to in 2010?
What page fault rate would allow MAT of 2x main memory access time.
Replacement Policy (Page)
FIFO Random Optimal LRU LRU approximation
Sample References
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
FIFO – 4 pages
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
2
1 4
3 72104
2 0 1 2
1 20
3
3 4 0 1
7 0 1 2 3 4 0
Optimal – 4 pages
7 0 1 2 0 3 0 4 2 3 0 3 2 1 0 1 7 0 1
2
1 4
2 112
1 7
0 00
4
0 0
7 3 3 3 3
LRU – 4 pages
7 0 1 2 0 3 0 4 2 3 0 3 2 1 0 1 7 0 1
2
1 1
2 222
1 1
0 00
4
0 0
7 3 3 3 7
Your Turn
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
Show FIFO, LRU, Optimal for references above but with 3 pages.