Download presentation
Presentation is loading. Please wait.
Published byLenard Green Modified over 9 years ago
1
Memory Management What if pgm mem > main mem ?
2
Memory Management What if pgm mem > main mem ? Overlays – program controlled
3
Memory Management What if pgm mem > main mem ? Virtual Memory – OS controlled (with architecture help)
4
Memory Management Separate physical, logical address space Separate physical, logical address space Page faults Page faults Demand paging Demand paging
5
Memory Access in VM Is access legal ? (seg fault) Is access legal ? (seg fault) If page in physical memory, return mem If page in physical memory, return mem Else Else Find free page Find free page Schedule disk operation Schedule disk operation Perform disk operation Perform disk operation Update page table Update page table Restart program at offending address Restart program at offending address
6
Memory Access Time Assume machine characteristics Assume machine characteristics 200ns clock rate 200ns clock rate Main Mem access of 5 cycles 1000ns Main Mem access of 5 cycles 1000ns 25 milisecond page service time 25 milisecond page service time
7
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 = 999 + 25,000 26x penalty
8
Your Turn Those were 1998 numbers Those were 1998 numbers Assume 2x speedup in clock speed every two years, 2x speedup in disk access time every 4 years 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 2014? What penalty would.001 page fault rate lead to in 2014? What page fault rate would allow MAT of 2x main memory access time. What page fault rate would allow MAT of 2x main memory access time.
9
Replacement Policy (Page) FIFO FIFO Random Random Optimal Optimal LRU LRU LRU approximation LRU approximation
10
Sample References 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
11
FIFO – 4 pages 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 2 14 372104 2012 120 3 3401 7012340
12
Optimal – 4 pages 7 0 1 2 0 3 0 4 2 3 0 3 2 1 0 1 7 0 1 2 14 2112 17 000 4 02 73330
13
LRU – 4 pages 7 0 1 2 0 3 0 4 2 3 0 3 2 1 0 1 7 0 1 2 13 3114 27 120 3 22 70000
14
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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.