13 - Operating Sytems Memory Management
13 - Operating Sytems Memory Management
Computer Architecture
CT049-3-1-OS&CA
Ver: VD1
Memory Management
Learning Outcomes
page 0 0 1 0
page 1 1 4 1 page 0
page 2 2 3 2
page 3 3 7 3 page 2
logical memory page table
4 page 1
7 page 3
physical memory
Secondary
Storage
4 5 6 7
8 9 10 11
Program B
12 13 14 15
Swap In
16 17 18 19
• What is Segmentation?
– Segmentation is a memory-management
scheme that supports a user view of memory.
– A logical address space is a collection of
segments. Each segment has a name and a
length.
– The addresses specify both the segment
name and the offset within the segment.
stack
segment 3 1400
Limit Base segment 0
0 1000 1400
symbol 2400
subroutine 1 400 6300
table 3200
2 400 4300
segment 0 segment 4
3 1100 3200 segment 3
4 1000 4700 4300
main segment 2
SQRT Segment table 4700
program
segment 4
segment 1 segment 2
5700
6300
Physical memory 6700 segment 1
Logical address space
CT049-3-1-OS&CA Memory Management 11 of 39
Shared Segmentation
0
Limit Base
editor 43062
0 25286 43062
segment 0
1 4425 68348
editor
data 1 segment table process P1
segment 1 68348
data 1
72773
logical memory process P1
reference
1 2 trap
i backing
load M store
6 page table Free
restart
frame
instruction
5 4
reset bring in
page memory
table page
program physical
execution memory
CT049-3-1-OS&CA Memory Management 16 of 39
Page Fault
16
14
12
number of page faults
10
8
0 1 2 3 4 5 6 7
number of frames
page-fault curve for FIFO replacement on a reference string
CT049-3-1-OS&CA Memory Management 29 of 39
Optimal
reference string
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
7 7 7 2 2 2 2 2 2 2 2 2 2 2 2 2 2 7 7 7
0 0 0 0 0 0 4 4 4 0 0 0 0 0 0 0 0 0 0
1 1 1 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1
Perform an Analysis of the Optimal Algorithm for the following string of memory
reference addresses. Assume that there are three frames available within the
memory for holding pages.
CT049-3-1-OS&CA Memory Management 31 of 39
Least Recently Used
Perform an Analysis of the Least recently used for the following string of memory
reference addresses. Assume that there are three frames available within the
memory for holding pages.
CT049-3-1-OS&CA Memory Management 33 of 39
Thrashing
degree of multiprogramming
CT049-3-1-OS&CA Memory Management 35 of 39
Question
Q&A
CT049-3-1-OS&CA Memory Management 39 of 39