Main MEM ORY MAN Agem ENT: Pres Ente D By: Anne N I. L Orin O C. Lin Gato NG
Main MEM ORY MAN Agem ENT: Pres Ente D By: Anne N I. L Orin O C. Lin Gato NG
M E M
A I N E N T
M G E M NT E D BY:
A S E
E I NO
M A N I A SH A
PR
N N E N
L I
I. L
NG
O
A
R
T O NG
MAR C .
KEN
INTRODUCTION TO MEMORY
MANAGEMNT
CPU
250 225
MEMORY
0
Logical
LogicalAddress
Address Physical
PhysicalAddress
Address
Computed
Computedbybythe
the Computed
Computedbybythe
the
CPU
CPU MMU
MMU
1. First-Fit Strategy
1. Dedicated Registers
3. Cache Memory
P1 = 1,000 pages
P2 = 3,000 pages
P3 = 6,000 pages
The allocation of each process depends on the
proportion of a process relative to the total number
of pages.
1, 2, 3, 4, 3, 1, 4, 2, 5, 2, 6, 2, 3, 1
The simulation trace is Time
TIME
Initially, the four main memory frames are
0
empty.
Page 1 is referenced by the process. Since
the main memory is empty, a page fault will
occur. Page 1 is copied from the hard disk to
1 frame 0 of the main memory. The page fault
is called initialization page fault and this
occurs while the memory frames are being
filled-up.
Page 2 is referenced. Since there are free
memory frames, an initialization page fault
2
will occur. Page 2 is copied from the hard
disk to frame 1 of the main memory.
Page 3 is referenced. Since there are free
memory frames, an initialization page fault
3 will occur. Page 3 is copied from the hard
disk to frame 2 of the main memory.
3. Second-Chance Algorithm
This solution works in the same manner as
FIFO algorithm. However, every page is tied to a
reference bit. If the reference bit is 1, the page
has been used. If the reference bit is 0, the page
was not used.
The operating system initially resets the
reference bits of all pages to 0. The reference bit of
a page that is used is set to 1.