Untitled

Download as pdf
Download as pdf
You are on page 1of 19
Mopule 42 Memory Manlag eMenT There are Ato Aipes of mange allocahon poltates- # Cocligtous memory allecaton Ce Non tondigious memory allocetfon . ' Beso: fous menor Moectio® 4 —> Fock process Bs contet nest re acai of sla? ana singte coutignoeus section dala Hegether. memory . Neco le “s lore dala tagether-S Cone of Uy another) + —> Braruple: Linked Ite L> Fromple: ree (1 HE] Boseodelress, ' : p Hecss olala loaseclon base nee ee nede fs not’ oldvesre ~ Accese Tre fs less. Airey, acces e0al- {to KB — <—_!0kB-> a Peske- AKB 2kB 4kB Ake AkB 4AbB Consiolir a axto cf the memory Tnease of non ~ontigis whe ake alrenely ccempiesd [memory Shocston, he by some othe procure anal BRE prruss poi ll tone, Zz a rtocks af the te gt: faltocetea inane mentor ad pacers P= eke has: leet gina f+ Non- “PCG stay she mot menrory - Sine <— tokKB—+ 24 is torcligfous 24 canned use 4 KB. Though dere Fie a8 i. are gkB spac, sHil AKB [ahere fs no &xtena] J be. bibized «THES Faggmentatton Conslttion i ge Tanow ns Seal Be OPTS Se ~ mire parttront. a J nrg ah allocahten: mentor 4 eonttatous | JU Cond) tous Memoay AtlocaHto ry ye | — veritable 2 rae Pont Honding Fee poss ont | j / (Peal ste Raton ray : j —> Partehons cannot beth internal anal eoctetna | i Ttxed size | be rteusecl - | | a4 leads lé | Paagmen lahion. |__Faterna | Fragmenlaton 1 vq 5 = Flechernal Frogmantahbn When enough meng entsle Te[ Tiare (i eno ! | sorted the mequeil af +he meno that fs ovetlab foe used Protas le partion, prouss bet cannot ox allocatest, sine Pt & not in but ft fo net ber ¢ @ continuous fastton- used. Tre tare Ps ~Tnlin preter i let ws eoretfeles wolve an e = re best Get ancl worl Jet af ae oy na Bisd det, oe 4 shod fs ageee IyAllccale the “fret #pace t a a lb ettnen at the begtant af the ea om oe where the prefeus fet - 3k bended the Search? ag sewn as we sind lo We Con slop free space thart & large enough. | dase process fe Go heeeO e aren Ten{. Gasala Mary os “ell search al dne emply Space fro ancl then fee ay aticeae eee eet sige tohich . Ie sacttefy the request: fs im the position pore i = G 2 ety afl starch all the emp ly space onel then PH lot ll allocale +H fotock ef Lang on sige fegepte ® ob 2 [yas us analets [rol firach atZe posehtHion? istth an exomple . Consider thot are A prowas? Pi = BG p, «210 , Fe =HO8 eam. We have IF allocate » #210, KBEABE ¢ A —— spo nol Gost 4, pesd $44 ancl word go: ea 400 600 60 B00 260 are above cliagrom shows the current 4lale of memory BBA 210 Abs 1 Re e-L T | 200 400 600 220 250 BOO 43454901 22 —> wos Ged Circlernal frag mentabis) (Ealinalso96 42004256 = Fragmentation 5) wasléal (Net able ix allecstz P4491) ot Au 468 210 Bet pfelPe fey 5 hee “200 400 650 | BOO/ B00 S boost Trternal Fragen lockion : re =P no 2 250 Ar alte le allowle Ps and Pa becawse of aod Zot He 210 Pu 43] Pe Bu 200 400 600 600 300 einal Fogmere, cust Bik s bert and Wont Te se saodthentng. it rm Evanple: A prowess * P= z00,Ps ~2 6, Fai Cop ngtolr rere ate . Pr. cased Pet a ra Py ew: der ws 40's tH wala sfiuet Pet, bert oq “ak 4 pe obg ont hm and wort « d ZA -AZ_—_——e 5D (5d Boo Bed boo tn aw case 5D, S00 ancl 600 are already alloathey sillocale th Jour pouss to dhe 2 blocks of top, nal ee aaa 25 ps Boo: 5D ag ZZ ZA (so B00 350 Goo. Rs ae | | Best RB it? BZ = LZ WEA. ‘ | bo 15D KAA 7 | : eae vdheca (Eoclerrios en ‘e WB tute not able le OeeePy Hae ree Peegn. Fern 25 ps Zoo ute Ze ZZ We B00 coma | oa tate Cade "Bite a the wou ansong | the three. | a sable Steal Part brontreg 2 mryessaralaiviany | = | Yost hae pave o paecleffract portthton « + Aceoreltng ip the nequerl of process the moon } d ls partthibrud and allocaléd * + No chance of Actemal Fre menclodton:: + Tt may hare e¢1 RoktHtontng i- (ak DOP have predefined pootthton « (4 The parififon once gel connel be reused ttenal fragmentation « +) Dead le & Ths tl kT ma pve ectemnal “Gppeess” TRANSCATION™ Appeess (Ee. convesion OF foetal ADDRESS TO PHYSICAL AppRess |b cpu geri Bog teal oudress ancl et ts Known bg ee f i | ferme! “Fnegmentanty ne leseee Size |Beconclary memory. | Phyaiteal weldlress fs recognizes! by mofn menory. 7 [thu oclelress fn whiehthe — prouss fs eneeuled fn the | madn mencory fs known as. Prgsteal oolclrers CPU cannes clirectly Docale. the Physfeal addreys- Pogeeal aclelress to ph Tea | address, we are usin, Aas0 alefeperenl Componen lf :- | Liuth Rag tel —> Relocahton Pegteten. Mush Regie - FH apeatptes te ett of caarrently anccuttng prowss, Example 9-100 for poouss Pre Ade hogrex | odldrest orcas tne, Ltt shen 2h es Pn atmap- lafpnet tre CPu will acces the mapin meniory . sk To conveet Hats Relocation Register: corona | p+ gloves Mo glatirg aclelress Of The Curren} pee lobutch Ps fp dre main manor» Tt Aobps le ise | | decale tne Phystenl Unelelress of tha moti, memory. Ln aelelress allocation: Te below altagran Cana latfon» ts elon. & | Thts & Pow clone Ua eno | condsy Reus i ye_workly | dllust ra. @u Bdoi2s ~ 625° 1S boots = 515 | Consutolex an exouple phue gou have Proess Py with | leo frotauchiors from (4-100). The logteal ocldresr | of Pt for each Instruchton gloaic from 4 ancl goes tl | leo. Py nels 15 be fneculiel , 0 nuemo zpos fs allecalal fn metfn memory . The phaeteal aclelress will the CPU Rocots die Li negrelix for Py & from GOI — boo. How ih natn memory 2 Jn Hite cose, has a Prt from actoo)., af tnstratton tor) tegeco| aolclress drat fneveases (00 % dltsardea Accor diy 15 Pete example, ler us Control the base aaldlvess % 50. Tho togtea! actress of as has lb be locarled, 4 ferst Chocks eth the pint] 2 fel (ASLIOC), The relocation 2 le. relocal uth matin nieuoyy by assfqning physreal aolelress Ye | fi p Repose pees py (eDOFIS = BR <). the P ystcal aclelyess fs Bc, jhe atnstruchion (3 ene cutee’ | example: Prouss - turd Relocehon | Logteal Phystea! | Regs la Regs ler Alclel r eg yess - 5o (2 Po OO oe AGO => (bs50 1p ots 5BO Boo => Tanp (2 ot ‘2. &8o 210 =P Trap f 20 {> : A oc ASO => Trap "a 1g 200 |. 8? =p 28D | peblams 6 Dirachnnlaige, fe Contptous menos - Kaumat ancl Erclemnal retin”. ov Meno’ i net usect fo oftecren | way. Aclvanlapes of "Cont gfous memory :- & Adelress “Genslatton is easy. Noxl= ter! trevovs MEMORY ALLocatOR/S*SEivag danwbhack of contig fous tema; To overcome the allocation , Ahk non- wont 9 Aelodusl wry used “There are Awo *Fpes ef hen - contig fou a) Paging C 2).Ga9 menterHon w ame Foaing fs 0 emenl eg kFlt ther punt dhe dine phys teal aclcress Space ef a nen ~conhiy fous Cmain memory) ‘ fous memory cllocane n a memory allocatton . memory mo prouss le be * Secondary memory ve dtytcled thle Et Steed porttHen novo as pages , al cu cal TESS IP pik 3 | pe Rage number, D+ debts P,P, Pa. | As off'sel- Cia Dob4t ts Afvtclat sald |? =Prame Number P\,Po,Pa- _ Mast n40) WH He Male wee pest en 1S ROW aL frames. FR . Pordthvon in ruain enor relies ener Prefs Sormbe Mir a | . gj memon ) Should be same. q The Legécal oalelvess genasied & cpu ts dtteled las [P[a] ct) Pe- Page Number, olec- Offset” Siracture which hos the Every Preuss has Plo | Fage Table fe a dala |base acldvers ef each fromes - | own page Table Physteal Address alttdecl tals Iwo os Eta] cay, fofomenlimber, de OHset” lo tre atfagaom , Al us Consider Po, ar Prom 4. of main mentory. To base address af each frame. baie address. From the Acwrdlehg nd has [6 tecole elo tract HY requtves The pagelble loves the page lable the dose oclelress of Po & xlooF- using dne bastaclelress fo malin dhe cpu con Aocolz To? ollows non-tontigtous memory | memory. Fog tng | menagerertt* . “Advanliges 2) | # heuss fs dock : : be skess TS pen-contigfous - | 4 Nl extemal Paagmertadvon |Ditedvarloges > aHos le vememb ce bose address of every pege: | Bvety proust host Ie generale fF own peqe table + | Tallin pagmentahton ae Sse = EN ¥ eae ee ll oy oejesealaT aoblem of Urctennal frogmentecton = a |= overteme ‘he ; | pow: meus’ segment atom: Seamenlictton allas ls q ’, os eloie dala tontFous -pachion woe unequal parinan, | The Logfes! aclelvess | fo segmentalon are repretentegl | Sa] Ut) Gelencdes segmerl Number anc Dodfspla i as ) Oo sp tape | Seamett Table : The fegmenl Table consfele of = cole ii Si ¢ orl Numbes, Base Address and size. the eee cuts fhe hg odessa ach 8 menl ted te gloved fadthe» main memory Thi atice Idencles the stke af each Aegmrenti fo the matin below dtagram explains to concep} oa aseunat?o tahue we hare a acld resin memory. “The | cegmenlatfon. Consteer oe hed Pe olfvEded) fnlo Seanad and) Woasdedt ty memory |4the mat ar Ip tep lacemment le ag cro van focacte segment number a sya 6 Atsplacemes| eo. The Sand A vst conndel rst jan samen table. AeeorelPng 12 the segmenl delle; aslel ress of Segment 2 fs Q-teo, the | dhe base fs svo (soo< 600) > go ict ust ll Aisplaamerl calealalé the physfeal address (O100+500) = Z200, cme (PU fs alivectecl IE the cenecuted: Thes tte dow the oo lath: Bmentatton: parttculoy frebuch'on anal i fs converted! le physical aeldress There fs no Pragnerlabton problem fies} Seq rey. usec! et bratentty withorl any fn Tre memory Fe was lige: Aelvantages! Deval ee mentation: fn compar fron No i | «oe men! table tons umes less space | le 2 Table mn Para dion: | Pe Regma ation -— eae ag ea) eprom The | ”) ie ot re re tnlo As prousses _memorg 9 the Mong Lyclernel Fog | [pHle pred ’ gS . 2 , ‘ CMe ~ a. A torrpuln ton aeldlress More moor thon the i | Vituel OMouaG dhe cysem. A" aed " : ty SY gtorage allocrhon scheme (9 which secondar Bates Can lot odelvessed OS Jnough tH were a parlof tne is i Mr) pryattal nslal led on | menage + of prowse can be avoappeel tn and ol 4 the mate ch that 14 oeupies alefferent pleas fn dhe “fferenl Himes durteg thes course of memory “mmatn memory at A eneenhon: Aol prowss mney be broken fnlé anumber ef peas anal hese ppieus ere) net be continuous ly jected =, the main memory The combtnadion of agnamfe 7 trontlaHon and use of page or seamen! [abl fe able permtle | hts. “ger WG + I+ fs nol neussary Het allthe poget or | segment should be presexl fn the main memory arin exnecuh on: of The veqputved pages n required d uring execution. n-Hime address eed (oe foe loaded ‘nle memory | bohenever | A Viehunl menor Pa ond D Seam andl swapping . \ ‘e tmp lemerled using Demand a | ei “all cea m7 5 lo ey with | Mafr memor 7 | lo frames! Seconclay pees tin + procs s | and tb ages. | The prouss toaclfng the pages Palo memory om | clemane! (whenever page Jautt oceurs) fs known as dlemanel paging. att the CPO res 18 refer [5 0 page thot Ps ‘curvendiy not avaPlable fn the mafn memozy y t+ generates (an interrupt Anco: tra @ memorg acess fault | The O8 pals the firtemptecl process fn a blocking |elalt: For the enecuhfon Ie proeect the OS maf] bring the, requ free page fnld the memory - 4 Tie OS will cearch for the requtved page fn the eg teal aclelress space. + The regufreel page will be brought a laddress f poe le phyetcal aceress epace: The. pege lacemert! algertthms are used for the deafon- | makin yeplactng the pege tm physteal acldrecs space. | Gj oF replectng é Py cps from logteal porn oy i ietwe CPU IB conten iv) te The page lable athe signal ofl be cent program enccut tod anol th will plac Ihe process |, © the ae ye ready sale” K Pats Qwwappit Me utc Swopp ly a process means sremoving all tlre | J 1 allel TIE popes | memory. Peges from, | a lf someHme lattr , the % slim soaps | P back the | prouss cpem_ the secondary gléege 1% the mat me | mor, | lelvanl&Ges - ‘J: joa Mibreso pre ate may ball maticted fh dh memor emer. edeprearar| ublixaHon af ty e ee 4 leaels le more proussor: ap A process lerger than the mafn mem oneeuted because of alemand paging: eee ORITHM Se, LPAME REPEAL ATH fs the technique useel b: Operating Syst l Stem (6 dectele which ane poges lo swap ou! apo!’ #A4 also dectedles abou! Aow f allocates! for each peruse fo. dhe coe lee ee af hohen page nepl : ‘os Be a ep cement fe stequtrec| frames drat ote le be seep | coal gee mss | Reference Stating 2— Statin or ing of mem callece| Reference city, “9 ra fage fault :- tH fs o Ujpe af inpermupl Hafees| when mouss Oecasses a memory pages that a nol Loacled to the ~, vs Q sunnin mappest inls varrlial memory bal ee our \e on memory » . Weare ave three Agpes of pege Repleacemer| llgen tthe: “oy Bast Jn Rast Out (FILEO) + Repla cament —> Optimal Page Useel CLRUD Algorithm. —> least- Recently _ | peer ESOT REE eA CAnemaany | Vey aineple '5 implemen] | + Olded page Ps step lacect for replacement’ * Performance. Ps nol always goed. | Bromple:~ : Caluclald nov of page Joule Jor the Allowing neJerence Saving ge 4,2/3,4 18,512,347) 5 | Consol 3 frames ate -thene in main memory . “| Cosecty :- 5 Frames - 1)2\)2)4)4 2[e[ 4) 2] 2) #]= | a [ala = 7 alalala]elelelsle| > | 2 a\o\o \ Vit itis 2 | fs a {a| 71? al2lolal » fal ela [al aL oe) tle le] a Voge Soult: 4 Page Hit +B, cane case Of ADromes. SHE TRE Manag, IP : " Page | sn ceatetn se -page fou tt may fnerease ast the I nuinber of allecocleal frames facreases. This case &s known os Beladys vramoly: Optimar Pane RercaceMeNT ALeoritHm: # Ievwert wor) less numberof Page aut. # Replaw the poge thot Ps not usecl for Aongert pertod af time. + T+ Rooks Sor es tn ee ts Set ot rhea Euan le : Coluilalz the No-ef page Jeulli Ie, the Following sebestence Hating. 5,0, 2,075, Or, 2,8, 0, B, 22400, AsO Considex the tolad no. of frames =3. i ig OS wiei|sios loi ilolibylol, 7) | i 1 tbat bee Lal | No. of page Joell > 4 | an | yeast Recently Usep, CLRU) AcéoRitHM: | Hage which Ros nol been usec dor the tonger! Hme ta main memory Jne one which will be seleded for x aay t | D | oF [in | yephaume ” | wt ts athe optimal page replacement algontihm rel fp, Hime: Doo king Arockwe { eee vy Caleulale the ne ot faults fo tne f = % > * > ¥ > > ; lalallala lo [elt ‘puncarion Aces 7S ME “Thee ave aifpero™! Agpes of allecaton aljon him aay, fq wet allocalvon 3- allocation equal number o | cots lype of Va nae be ellocatee! for och prtecers, ' anal prose. ale -frtam eg ; Jaame buffet +4 it the belous trample ce process? tokKB ane we hove Erdaodtve Pale Bose pros s a> 1tkB, Ne hove 6% pre Jrames - we mes trate the ve 2 proses. | dyer frames bY 2 * ee g i frames bal! | ga fnesdrems = \ ei frame . Cony felis He at'xs ef eoch faome Ps Bs kB. Jn | aide ese tre glvelnl- prouss will Oceupy Io taames of Coch 1k6- Remain frag ackB &% Jed eat: wuect. To overcome thfs p2tellen he. proportona| allocation & nse. Fropoa tone! Allocatton, 3— Tn tres we allocate avarfalole memory 15 each procs aeronelfng ls ae To caleulale the formula oe a ap = Rte fe S > Tolat Potames m > Total ne: ef avatlable fame Censteler dhe same Gluclent prouss—> lokP rtesackve DB preuss > 1aT KB Sludenf prouss > | | kAllocatfon af each |rmulHpaegramating : | xy mutitptegsammtng $4 matlfpregnamming decreases frame Altocatin Pnereases: Global versus Local Al |@bbal Replaament = | Current \y allocated lé Can take Qa frame Local Replacement : . " itreal frame af 1" proass. ‘ae —> Frame allocwtec! 16 process pr dexacve DB proctss—> ay woo 84 frames according Ab allows % prowss Is selecka step lacomeril frame | Prom ane cet of al frames, even Pf thal frame fs qrepeseratcMayy ly Plege treet cxample of Rprouss . 4 (BIKB Tofay top *62 24 | AeA Bethlpacass alee (24 lo +thety nesels process vers) accoreling le the fncreases fname allecatfag dlecteoses. | locah’en : Bome olhert process » One prowess From onethen. Fadn proust gabeck prom enly PZ exon sek of allocded fromes- | |

You might also like