Sie sind auf Seite 1von 5

MEMORY MANAGEMENT : EARLY SYSTEM MEMORY MANAGER

Chapter 2

TYPES OF MEMORY ALLOCATION SCHEMES: Single-User System fi e! "artiti#ns$ %ynami& "artiti#ns an! Rel#&ata'le %ynami& "artiti#ns(

SINGLE- USER CONFIGURATION - The first mem#ry all#&ati#n


s&heme )#r*e! li*e this: Ea&h pr#gram t# 'e pr#&esse! )as l#a!e! in its entirety int# mem#ry an! all#&ate! as m+&h as &#ntig+#+s spa&e in mem#ry as it nee!e!( The *ey)#r! here is entirety and contiguous(
SINGLE USER SYSTEMS ea&h +ser is gi,en a&&ess t# all a,aila'le main mem#ry f#r ea&h -#'$ an! -#'s are pr#&esse! se.+entially$ #ne after the #ther( T# all#&ate mem#ry the #perating system +ses a simple alg#rithm(

Algorithm to Load a Jo i! a Si!gl"-U#"r S$#t"m% /( 2( 0( 1( 3( 6( 6( 8( 9( :( St#re first mem#ry all#&ati#n #f pr#gram int# 'ase register( Set pr#gram &#+nter( Rea! first instr+&ti#n #f the pr#gram( 2n&rement pr#gram &#+nter 'y n+m'er #f 'ytes in instr+&ti#n( 4as the last instr+&ti#n 'een rea&he!5 2f yes$ then st#p l#a!ing pr#gram( 2f N#$ then &#ntin+e )ith step 6( 2s pr#gram &#+nter greater than mem#ry si7e5 2f yes$ then st#p l#a!ing pr#gram( 2f N#$ then &#ntin+e )ith step 8( L#a! instr+&ti#n in mem#ry( Rea! ne t instr+&ti#n #f pr#gram( G# t# step 1(

FI&E' PARTITIONS - The first attempt t# all#) m+ltipr#gramming


)as t# &reate fi e! partiti#ns ;als# &alle! stati& partiti#ns< )ithin the main mem#ry = #ne partiti#n f#r ea&h -#'( Main mem#ry is se&ti#ne! #ff$ )ith p#rti#ns assigne! t# ea&h +ser( On&e the system )as in #perati#n the partiti#ns si7es remaine! stati&(

>Mem#ry is the primary an! f+n!amental p#)er$ )ith#+t )hi&h there &#+l! 'e n# #ther intelle&t+al #perati#n(? =Sam+el @#hns#n ;/8A:-/891<

"age /

MEMORY MANAGEMENT : EARLY SYSTEM

Chapter 2

A &riti&al fa&t#r )as intr#!+&e! )ith this s&heme: pr#te&ti#n #f the -#'Bs mem#ry spa&e( On&e a partiti#n )as assigne! t# a -#'$ n# #ther -#' &#+l! 'e all#)e! t# enter its '#+n!aries$ either a&&i!entally #r intenti#nally(

Algorithm to Load a Job in Fixed Partitions


/( %etermine -#'s re.+este! mem#ry si7e(
#$RTITI%N SI&E /AAH 23H 23H 3AH MEM%RY $''RESS 2AAH 0AAH 023H 03AH @OI 2 $((ESS @OI / @OI 1 #$RTITI%N ST$TUS )USY )USY FREE )USY

2(

2f -#'Csi7e D si7e #f largest partiti#n Then re-e&t the -#' print appr#priate message t# #perat#r g# t# step / t# han!le ne t -#' in line Else &#ntin+e )ith step 0(

0( Set &#+nter /( 1( %# )hile &#+nter EF n+m'er #f partiti#ns in mem#ry

2f -#'Csi7e D mem#ryCpartiti#nCsi7e;&#+nter< Then &#+nter F &#+nter G / Else if mem#ryCpartiti#nCsi7e;&#+nter< F >free? Then l#a! -#' int# mem#ryCpartiti#n;&#+nter< &hange mem#ryCpartiti#nCstat+s;&#+nter<t# >'+sy? g# t# step / t# han!le ne t -#' in line Else &#+nter F &#+nter G / En! !# 3 ( N# partiti#n a,aila'le at this time$ p+t -#' in )aiting .+e+e( 6( G# t# step / t# han!le ne t -#' in line(

'YNAMIC PARTITIONS - A mem#ry all#&ati#n s&heme in )hi&h -#'s are gi,en


s+&h as m+&h mem#ry as they re.+est )hen they are l#a!e! f#r pr#&essing$ th+s &reating their #)n partiti#n in main mem#ry( First come, first serve basis. A,aila'le mem#ry is still *ept in &#ntig+#+s 'l#&*s '+t -#'s are gi,en #nly as m+&h mem#ry as they re.+est )hen they are l#a!e! an! pr#&essing(

Exter a! fra"me tatio

mem#ry &reates +n+sa'le fragments #f free mem#ry 'et)een 'l#&*s #f '+sy$ #r all#&ate!$ mem#ry( I ter a! fra"me tatio the remaining spa&e 'et)een the partiti#ns is +na,aila'le t# any #ther -#' an! is theref#re )aste!(

a sit+ati#n in )hi&h !ynami& all#&ati#n #f

MEMORY MANAGEMENT : EARLY SYSTEM

Chapter 2

(EST FIT )ERSUS FIRST FIT ALLOCATION


)est*Fit Memor+ $!!ocatio =a main mem#ry all#&ati#n s&heme that &#nsi!ers all free 'l#&*s an! sele&ts f#r all#&ati#n the #ne that )ill res+lt in the least am#+nt #f )aste! spa&e( First*Fit Memor+ $!!ocatio a main mem#ry all#&ati#n s&heme that sear&hes fr#m the 'eginning #f the free 'l#&* list an! sele&ts f#r all#&ati#n the first 'l#&* #f mem#ry large en#+gh t# f+lfill the re.+est(

Fir#t-Fit Algorithm
/( Set &#+nter t# /( 2( %# )hile &#+nter EF n+m'er #f 'l#&*s in mem#ry( if -#'Csi7e D mem#ryCsi7e;&#+nter< Then &#+nter F &#+nter G / Else l#a! -#' int# mem#ryCsi7e;&#+nter< a!-+st freeJ'+sy mem#ry lists g# t# step 1 En! !# 0( "+t -#' in )aiting .+e+e( 1( G# fet&h ne t -#'(

("#t-Fit Algorithm
/( 2( 0( 1( 3( 2nitiali7e mem#ryC'l#&*;#< F ::::: C#mp+te initialCmem#ryC'l#&*;#<--#'Csi7e 2ntiali7e s+'s&riptF# Set &#+nter t# / %# )hile &#+nter EF n+m'er #f 'l#&*s in mem#ry if -#'Csi7e D mem#ry si7e ;&#+nter< Then &#+nter F &#+nter G/ Else mem#ryC)aste F mem#ryCsi7e ;&#+nter<--#'Csi7e 2f initialCmem#ryC)aste D mem#ryC)aste Then s+'s&ript F &#+nter 2nitialCmem#ryC)asteFmem#ryC)aste C#+nterF &#+nter G / En! !# 6( 2f s+'s&ript F # Then p+t -#' in )aiting .+e+e Else L#a! -#' int# mem#ryCsi7e ; s+'s&ript< A!-+st freeJ '+sy mem#ry lists 8( G# fet&h ne t -#'

'EALLOCATION
0

MEMORY MANAGEMENT : EARLY SYSTEM

Chapter 2

The pr#&ess #f freeing an all#&ate! res#+r&e$ )hether mem#ry spa&e$ a !e,i&e$ a file #r a C"U(

T,e s+stem -re-are. for t,ree a!ter ative sit/atio s 0Ma. ic1 2 'o ova , 34567
Case /: Khen the 'l#&* t# 'e !eall#&ate! is a!-a&ent t# an#ther free 'l#&*( Case 2: Khen the 'l#&* t# 'e !eall#&ate! is 'et)een t)# free 'l#&*s( Case 0: Khen the 'l#&* t# 'e !eall#&ate! is is#late! fr#m #ther free 'l#&*s(

RELOCATA(LE 'YNAMIC

A Mem#ry all#&ati#n s&heme in )hi&h the system rel#&ates pr#grams in mem#ry t# gather t#gether all #f the empty 'l#&*s an! &#mpa&t them t# ma*e #ne 'l#&* #f mem#ry thatBs large en#+gh t# a&&#mm#!ate s#me #r all #f the -#'s )aiting f#r mem#ry( Hil#'yte ;H< : a +nit #f mem#ry st#rage spa&e e.+al t# /$2A1 'ytes #r 2/A 'ytes( Rel#&ati#n : the pr#&ess #f m#,ing a pr#gram fr#m #ne area #f mem#ry t# an#ther( Rel#&ati#n register :a register &#ntains the ,al+e that m+st 'e a!!e! t# ea&h a!!ress referen&e! in the pr#gram s# that it )ill 'e a'le t# a&&ess the &#rre&t mem#ry a!!resses after rel#&ati#n(

PARTITIONS

SPECIAL-PURPOSE REGISTERS * are +se! t# help )ith the rel#&ati#n( (o+!d R"gi#t"r * a register +se! t# st#re the highest l#&ati#ns in mem#ry legally a&&essi'ly 'y ea&h pr#gram( R"lo,atio! R"gi#t"r * a register that &#ntains the ,al+e that m+st 'e a!!e! t# ea&h a!!ress referen&e! in the pr#gram s# that it )ill 'e a'le t# a&&ess the &#rre&t mem#ry a!!ress after rel#&ati#n(
:the !ata ,al+es :initiali7e register / $SSEM)LY L$NGU$GE :initiali7e register 2 #R%GR$M :a!! ;A G reg /< t# reg 2 :a!! / t# reg 2 :is reg /(1-/5 :if n#t$ g# t# l##p :if s#$ m#,e reg 2 t# reg 0 :!i,i!e reg 0 'y 1 :remain!er t# register 1 :en!

A EL" /02$ /11$ /23$ //A IEG2N: MOME2 /(A MOME2 2(A LOO": A%% 2(A;/< A%%2 /(/ CA2G /(1$@UM" LOO" MOME 0(2 2%2M2 0(1 EL2T EN%

MEMORY MANAGEMENT : EARLY SYSTEM

Chapter 2

AAAAAAB AAAAA/B AAAAA2B AAAAA0B AAAAA1B AAAAA3B AAAAA6B AAAAA8B AAAAA9B AAAAA:B AAAA/AB AAAA//B AAAA/2B

AAAAAA AAAAAA AAAAAA AAAAAA 2A/ 2A/ 28A 28/ 0A8 021 2AA 20/ A18 A/ A2 A2 A/ A/ AA A0 A0 A/

AAA/02 AAA/11 AAA/23 AAA//A A A A A A A A A A AA AA AA AA AA AA AA AA AA AAAAAA AAAAAA AAAAAA AAAAA/ AAAAA0 AAAAA6 AAAAA2 AAAAA1 AAAA/2

A:

EL"/02$/11$/23$//A

M$(8INE RE$'$)LE (%'E


IEG2N: LOO": MOME2 /(A MOME2 2(A A%% 2(A;/< A%%2 /(/ CA2G /$1-/ @UM"A LOO" MOM E 0(2 2%2M2 0(1 EL2T

AAAAAA

EN%

Das könnte Ihnen auch gefallen