You are on page 1of 78
- ws eles? Hesony Management: ; Conary eemony or Physical eeerers °F Ram) A Mex Gre feo views & memory 8 Teyseah view: Gy Mestwock view (Pagrammer’s view) + viewed 0, 1d array 4b esords ya & se Kade A > tenons fe} (Nwerds) @: TH site Ht word is ‘tn’ biks ond no iw in addvex ign” ao “4 Hen Hemory Capacity (hal wotels) =2"= N OT fesaetd be guords > Ns abil We 2 wordy, > lay 8 bits suk cat ded pibos Scanned with CamScanner | "pate —seemeenemaiiteneten ina deetieniliiaaas w J1P neagbie amor dt FF Gs on be addvened ey 25648 | > sh meth bs and corde erg th = bo bits . Rind copaeity A mentory interns d cols bby es bits. Sols gh 29M words 6 > HOB words a Star by oP bys? 2 48 gx 16 bits > 288 bibs = 286 G-bis 7 Wk capacity drrerrory bee Be Tbils and word sne be gu bik find eopacity meroy interns ex bys and cords ‘Sly e og This = "gh x2"? FoF bs bits. Henory Lopasuty in Sree wen iad Le i & ‘Hewrory capacity in bg words 2 oH nag uw 64 1 Loading vs L Linking et leading, of executable progtrt fron, bok fo memory. enki ha Hype waica 4 Sabie boadieg * Eire program’ & load belbre. i i Scanned with CamScanner leaded dasing runtime. In Stake loading ve (sd malady, Ac, PL)" ite memory- Houecer we we only ore oot A ALG - Tiss space inefficient - Ths ve com ese dijriamie loaditg ond load aby minds, iaiWebty and Rh lood either fe fi o G. Jbpyed on He requicement. A He Ne A execurvon Btoseer exeuthien hme ts more fue ae dynamic loading > Yoke loading + Space ineMecieaE, he efhereat Dyrawae lending: Space. efkicient, fine_ineFerent see PD iniy. =e) oC is is the proce, of ‘resolving eefernah references” Linking Ly fumetinn « voratle Cglobat) | or ony objects - ehEaC eee extern int 4; [enteral reference maine boat 5 bint Mtoe. os 6 96) inde HOS Med oer s wait) Hevadders 440 i A K) FE, ok. known eacldés- this seorfl) 1 is om umeeaoboad Whiences | BS 40) [I BSA aed y i veleene. | gc) Scanned with CamScanner [ee ana nbect 5 We (ang unregolveed fagheachorg, Vw SYS [terceates untesthed refeenca) Frecukable Fle Linkieg is af Awe types 5S gate Linkieg Qh) Dyrartic Lnleeg” State, Hiaetag - a Linkdeg ts done before wuthime 3 main} : maine) . wont) ) I 2 bed v ee ie. BSA — Unger eer ; Se 3 “Ay 5 $ey 1) ~ toor #C) ) Li i ate f 3 \ uw vere file Drwbatle: " j # Seyre med, ——- wade, may be linked odd Mig is, ih nePicieat. for cshich we Someone, may post oe linkiog AU wating (jeg late binding or yrarve Linkirg) A Mowers enecution a Program is falex in the coe | Gate Linking. For c1ey plazeet Unize cmresolued reference compiles | ewoctares a plece ct Cede called Stub. This ib when | Creche, of runtime Cot{s Linker. Scanned with CamScanner oe i i ns . i we 4 The Wibvies which are Uoked ak’ vinkime ore catlled Dyrarate Link Lbrovies (DLL) : 2 Tk is more space ficient Benehibs of dyromie \ ieg + space. effciensy onthe ant sf + Reugaloility & Utvories . + Reaibility & odieatien bag 1 Esebaggin g) becomes: 99847) / poten sat ty yl tnt 4 Pravsback ba k kine, inefticient’ € Security threat D Stae Uaking ts more seare- Hodose, needed i by tinker: = object code + exkenal refeences Relocarion Hits isrenalion physical ‘odd eb vot memory. | wy a Linker doe not need Addeess Bindicg Aasociaon of progam wo memory Waters is cabed adders bing sashrachions ond dala units bo Ty Lond OHI bialty Sr load biS oY : . By Load Re . , Ty: Load Rich e a ds Add RRL rt , i Sg 1 Biore ere a | | j Scanned with CamScanner r The Bae at Uhich binding taker face, s called bindig ime. Binding can take pue-place ati three Hoes bs Compile. Heme. Load Hine Ban bone Oyrornie i totic Congile Hime. Binding : + Compiler okociaey physical add verses . + The program is loaded ino: Reed memory lecabioes. Load hime Riadicg. Yee lender doa He cade of binding . Raed on He Unlue io base vegicler He inshsuchon are loaded \ joo rewtory. | Rankine Binding? Dyramic Relocation’) vere loader doe He cocck of binding “at b munbioe, 7 Tho pope ts swapped out ¥ TE mast be Suoapped ia ify “FR Some memoy locaton coe vse completing binding or lead Kine. binding %* ib ean he Susapped in Inbo different memory becahion | "hice | use wahime binding ? Fanchons £ t bool + Hemory Honager : | “Fanehions ava) | BAllecabon | ®) Protechion ' i) Address Translation Cone by HM). ) Free Space Honagement VY) Deallocabion Scanned with CamScanner ee ; “| > Effective yflizaton & vyremony , ieee Minienize Fragmentabvon oe Hunage He execabton & \seger program in a smalk memory seu Memory reanagement Techniguer Non - Genk quous Cones ieee proqram is a Hee progam may be can teabied divided into’ amdelules and different racdubes Loeey pregrarn FS prevent cP Pree may be at different Places ak one place Ey. PackiHions cheek By Raging. Sayre cont ; , mea tabion ui : Segorented Pag. 1 © ba Vidhual Memory. ‘Protection. a caerecation 16938) & bave reqisler carting shantiog address Ht the iprocent + Limit regisler etuing sre of precen. hap os ( Hop & an intecupt sont cup | yo 0s Ear Ro sensed y? Scanned with CamScanner Condquors Memory Momogem mer Rennvyeshs 2) Ghee verlag Assume we have oo) 2-Pos Assemider Beles ae sires of each modsse POBIL FOS POD. FOR Syralool ple 2 3okR Common Routines > 20% Overlay leader © overlay diver TOK hep 1, Pasay of (Pola are independent modules 2! dey Parl Can wan sthok any use dt Pa end Vice Ver be ve overly leoder loade, Pssame we hae oly teok® F free vent Syrtal toeke— \2p1e B ond meroy{ F210 KR tern 1s, lore Past, Lake ae pam is a overlayed Lieflaced ), by pour Limitahten > Program mut be paw bo dio medules g Saqon Cea ta) be divided into ‘independent Scanned with CamScanner : mt Fox dhe above overlay tree, shat is the minima amount of memory required fe execu 9: : 148) Dosing PE uc way need ABLE Cir Davie] PARZ Ue Woy Teed ABE Cies et) Sao Brak soy at Lome gary Ge may ved pnt We, OAL Bz Ek Bs A wen poss 26k 2 Hin semtony xequiced > 26k x requied > vex pa vets. fhom yoot ‘fo the leaves > Hioionamt meemy 8) Pashhons : fasti bons is ot 2 typeyy > Jo Feed Poebibioniay (yet: Hultipayremnteg voit Fized fo a Toss) dy Nawicle. Parti igang (wt: Habvipesarnening with Vawale. ~ no A Tesks) i Fixed ‘ong: ve Pavoni & Fred Park Kons: Shulve Pavhoniag ser oea Seis dtsited ints Reed no of fatibfer. | vee Pastibions may be daHlerent siaes, %* Bach poshkion, holds exactly pees sole 80k. Scanned with CamScanner ~~» Addis fanslaked 4 Polecion : ; ‘ Protection a feops addvenag error Allccakion Strategies + Fist Ae: ayseath from frst parthin and Store if oherever enough sized parton is found Rat Ke: . Seallerst Pree ond by enough pasiition Is choosen) woet hts Lasqest “ree. “ond ‘big ough portion Ts “choosen vet es ae hoeick Pie coorks ike AE encepe that # search shor Pree partion» Starts Poon loxt —allecation. Performance aes i * ater ‘ng Process ‘to o partition woe ugh “be tebe dot with * Some Space in the fared - The left out space even ih) ik can aceomelule a ned. pecess choulde't be .allleceked- This problem & ’ . : Called falemel Frogmentaton, ae Scanned with CamScanner ms Pax D Eremal Rogmerfation: io extersok Fragmentation 3) Degree A MAW pozrommieg ts resticted Yo ne & UW) siseetmron? Haninum process site thats munnable 15 \imited 5) Besk RE is Ae most “suitable allecabon Jechacque- cua i hax leoat amount 4 internah Frogmentatien ’ diy Vawable Park hens en Dynamic Park Honing AU Saleem eae Gabtions ave Created, Ayrarrvcally vat runbione + were. oe wainkaes ov jake bo keep AraFk BZ cshuch ports & enoiy ene onsite pk Hime kL aygume. we have belo requerts ok 7 10k; Yok 7 Sez. SOk; a fe & & fs user aca at. Ps. finishes, is .egecukon we hae two holes Of gok ond Sok Adjacent fo eath oer. Kew these frso will be joined » hes Joining 1 (poe ak odjacett holes is called coalescing. | Assume ober’ some bine Pp and: Py hey Aaithed) ereashen and we have a Nes’ proces requese & Py ob Ik- bo oe may Lae fist Re, bat Gt s wordt RE y next Sit: Scanned with CamScanner rot, Soy ve hone EF iF Gecbornance. truer —aenenerae Flic can't iecabe op Le No interna Eraginen bon so enioaf ir pres een (F YohaS awallalhe space 9 toe may hase: Eternal fragmentation oli. dureMten te she of Bye pevins cep example, ane arvureve hove a proces ro F Ssok , we can't place in He menwry. However fob availabe spece is more tran ssok- Thay we say tee ey have external Frogmentabion 3 Deg. A Hebe ts ,Alevible., As @ Hainan sie of wannabe Precen & also Hexible Pron Ser ‘sing bet hE creates, gmat Sree holex- There holes ae waged ny the bien, oF external Fragmentation. a¥ence wosst BE Ts best allocation shakey for dyramc porkiieniog. (ra Te iets given tok Ret beak ave bebkec Rese # best ave equally ged i Storage Ublirabisn, Hoses Fran doce BE + \ i Overcoming the problem a ‘rogmentabio ist Re es faster) Be overcoming, exterroh Fregmnertion woe have, 2 OY 5 Compaction @9 Defragmentation Abs Kone t,-amume Memory TS oh shoan below bos & ue have o povess (Oa) vequest ith Spe dsole “Ge” canOt * allocale it. +5 Congathion woves ali te fiacesses fem tp one place. : Fs tosever compatiion ix possible only if oe ue whine bindig. > Meo Compaction pukey 1 More time to finish’. Scanned with CamScanner EE l—~—~—— Herior Ree compachion is, ns ee a —— & } t 350k D Roa-Conhquooy Allocation, (Pegirg)) Te we don't wae conhiquors allecalion ue can Ars ple de the pegrm and place, it iq ditieeat holea- dius @) i i astk 3 dole 00 orc age > ae |_ 22 pgecttion 4. 600K 4 Sook «> go se iD = Kate be go 150300 Seer 0 CEHZLNZ) WL LWA) ~ Te, go ony Rak At 2. ot) Scanned with CamScanner T get denied aoors asi, provide racine hole pomible cosy To Kad Ste xq bbe deni & ed ue muse creote ® “rosin “pou oheles & 69 equal sire rou, pomisle holes = 3 thd fee space= Sho Sie # each hole Be, eo We 280 Igo 260 Igo LA _3 - Jr Atk Gan be denied in this cose @) Memory sites 9° bytes no f parking. g¥é - o fart Hora, 2 UH fark Hoag gariton adver (ete}222 bits dy sine F foiter to He neeneat: bye Vearet byle fe ot bits fs abies (ad 4 iis) © sie d each emby 2 sine (Rev) + site (Pi) > FEE 3+ lk byl 2 hye ile) 4X S00 > 2600 bytes Scanned with CamScanner Lead. here. ts -the, Hote chen Hey are, leaded into, memory. The lead Kone, # Ci P5riPa Py Pe is 0 . ed FA Er Nootka 04 ble a WL. ia reed RnB YY. EERE — a | an 6 4 9 Mm of lood Kine & % 314 P) Rr FoR Pat & ER * bso tei tp load Howe cf fe 229 Gomplebion hiner Can be , seenin the gant an Scanned with CamScanner 2: Non- Contiguous Memory Allocabion ‘Techniguer m Logica Address Space (Las) vs ‘Thysicad Addvess Space (PAS) o nual, Addvery Space (vas) . or Absolube. Coiduoh Aalders, Space (vas) (peal des Co) eae 9 Tall wriproponmed os, the adidrers generated y He program i physical add vers | Abo in corpile Hime binding & | lend Hine binding , the ald reas | greed pty by programa 1S Physical Aens, legicad addvers ashich 1S not epual fo physicok oddver, F Inthe sytlems we alors cPo fy geaeale > In nahine binding, the odd ves generated by He program is p tte corresponding lopicel avers and wHo chansbhes if fo PA- Tay Ws approach provides profechion becaxce we are not letting Crecating progr genewbe Ph and akcex memory drecty. vidual addren, ed (amy ah Memory 77 Rosed on He Kecnigine ne oye He hardvaare A AMY charges Thera Ib oy be Peete oy egret table > TF ae A PA is bis Hen oi pas mo” words also sie & MAR TS oy bis. > Fh site + VA Rm! ilk Hea LAS @D vag is also sre badder, bus of cpu sm "7 usords Scanned with CamScanner Le J The address bindieg ued i here is, puntine ‘binding. + > ws: I words La = bg tne tte > PAS 9h words PA = leq ens lets - ed Aheont¥caily + SAEZ LAS > PAS LAS < PAS LAS > PAS Bb prancady LAS > PAS dy Pag ing: (simple ging) Assume LAS> SER; PAS= hRR Page BITC IER , ) ' sy LA BBS, PAID bibs, > septs Organiaabion 4 LAS © PAS ete ro ee > LAS is divided into! equel’ site Unik, called — poges- 9 Fenerally: page acczpmees page size is fower of 2 (but not mecewacy trough) > mod Poqes e 8kg | Tee = 8 peje, SkE LAS fs in food pagey(W) ~ > Every page 8 given poge aurtbor ‘ or jo id- Scanned with CamScanner 7 Hoge Mo CP 2 lag: Lig, 8 | ie, {eg a = loge 3 kit } 7 | Rage olleet (a) = Es PST ier je P= leg k= log 2° to = He oe generally gelect yey page fat , then ae) me offset then ve % bw ‘required Cane Logical Address fmol 2 tno [oot | te, sy —_—> we Hs (La) Bs casey bs, 8 Poouks +hen We A pages, N= cas 22 pages bas > 2's Abn P= tog bik: dz eB 103 ps DB ir-biy a4 12 lexicoh advess humat LA Ge wsyen hey Pie pagy with paje fact q bie Hea Leo Pep lyatou a - »—- { Arr | LASS DP 1H Pow deq Scanned with CamScanner ee gq: Systern Suppor ls OA gr bis if peyesie is WER, ry (olidede. no A pages in System a: bs. 3 fs> ot a2 no & pops 2 =! poyes oe 1 Ne 2% v Hethed 2D - o) Pears ano 4 Gpae (Ne 2' SEPZ! ongpaiaabion of FAS! > pis is divided IMS equal sine units knaan ey fames Comoe. Prames) » 2 { Frome cine CFS) = Page site a 7 Any page can be, shored ia ony Frame (100 cathy. allocation) | In He erade, ‘ PAS= ARR Pak ho & rane, = PAS | (Hy) PS” i —— nfs i n| % | alhene bol BY = toy H ky n “ oe et = ppt =a] ees 2 © > Physick addres, format: mee a Scanned with CamScanner HL Pass WER, de abs . ‘ aie oy a Hea “how Ha ReZTAS Phy ates Prenat _ ws # a) ahs ing A Frames = 2$ ww) > page sre = 2%: SH Byey g° Sysien hes oo La A as blk coil! gle gage) 1D it hes, 986 Frames then tule Sod’ “fh PAE Sah = “ was > 252 3208 no pagans ale= pe | | | | ) a page snes LAS, FF 438 bylen | ” | page Hk Cd) +23, no & Franes(H) + 256 Roane iver ($Y log; 256°>e ep er COREY PAZ ]A) sper hay LA dw bibs wilh a pegs Ste A gke- TPA S 24 bin Calculabe. no A Provnes- sgh 5 8 pS 3 ded ore (eTs] zy fei to 2 pages "Ramen 52 Scanned with CamScanner Frames o Procers Management Uolunel : rocews mente Uchine| im Sytem cals ave onked by o-pAN OYA Inchauclion ich gererokes 0. sobbwore intesrupt- tet all puilaged._ incrwerions z-opt © generate sho inleeupt » Scheduler pwcets comes ondy ater ara proces feveriod ken B Quer failure dso camer inhernupt Lo Redietion Been] proces TS annotated with 3 Gaaderd Biles (by default) Srdin keybedd Srdost + monitor ttdery t moniter To wdirechion is O& concept ia which some other fle wroybe yyed in the place any ot He 3 thondard Bley. cg eens 2 12 + 6 : Schedule length + -0= 16 » 7 ——— 2 0g Lone powible Cut idle Kee mui be 0-6 ° Gal ! ot w& idle brent snot poxdble D Mis. sequence is pombe cue we Can keep He procenor idle drug need. Zee ay "Scanned with CamScanner monensin Here both option a4d one possible row we wed te decide cdhich i opkonal- Optienad ty depends 09 aug. TAT, aug uke , CPU UHlitabion ebe, Also opt @ filloas STE which rs ophmal “-ot® ou oO - his pacmas Procers gels more time i one und - ) Twi ackion ents ia ging mor prdnty to He procen. sPAPworititigg is more, TH Yeads ty Stawvabion. © los BT are giver high pronty S) the lost quene of multilevel Red kak @ uses FERS Git) Be igh prowtty is given bs lows avvisol bee processes. w) RRA SSE den't have Any ‘elakon Here ue take response time 04 cantly hime. Thos ts ger feast oaitieg Kee is ghen by STF Scredubieg coq: iS ns Xt (xeos) <%36/6,49 det Cx Scanned with CamScanner oon seaident means Be butsidle: i “Sisk foes, suspended procers. . oa, Vy slo4 wrighed 0) Event sakfuckion ” i i Cable ov page map Fable or addres franslabien » Hw ia paging is pogertble or ff a > Gach procenser thea ids can —POge rable > Poge tables ave generating shoved In MemONJe > Regt tubes As organized as 0 Sek of entries w and each entry Pe a ee > pod Ghetable in PT 2 no F payer 9 LAS yet catrieg conning the frame to (#) in ashich the Rice pectenti steed cach entry ‘ J eth) —_| ® fo | ieee he & fy Pe PAS a Oe able (HHU)) PT enbies are. generally in byte. table eee = Kod pigs in Lag xsire a each enhry = Ne Scanned with CamScanner Oddvers an hanclytten (Logie to Phystcot) a Je aats Fe | faye fogs le bene nuraber gage nuvber a Cowesponds fy dM wort in gage fame o sodelll Lassu bias PAs24 biky Se BK: | Cee pages = YPASY , 3 Mheang> 2 psy ob hse * Hoke see) art Find ema of “Uegical addres, and ya adden, Find sire 4 * gage table Copier): Fo Mie mh CMe , Las: 8 > 1608 maint pac at = he MB H bames 2 oe = git Fame, d= ley p= log 2? o8 Ri mee vw = Scanned with CamScanner en 13 fe log 21 x logical edd sens focrmat poor [428 <— HK fhysal oddven Foemate — 4 gue a pogetable> nod pages Comin) x se each ery > Plath bis . byes (ane entry 26) > 2 Duns Consider 0 wep Sylow Supporting a a2 Lit VAS calth & paye she de eR. TE pas ws CHK Coluilale Ye approninale PT site ia hyve: SI qs2 0 neo VAS2 B pas: ve ia 0 Magy = 2 29% pages 3 36 Mfume > 2 gt Reames oe cre A PTenby = 14 bits 2 bytes sie Pprs g’xa> 8 2NB Scanned with CamScanner s = 2 bye, PTs= aux? bys zat No ¢ gays aaxz? 3 logical address [53 LA > 23413236 bils 5 Bares Qe Pages bass 22 6448 © ae Nez > Peleg Z Met oy Be log uy L Qeprday dadP 448 ‘A dod loye , Pass 2 Z2 Lata bik oy Lass BE PTES = & byl PIs 1 Aame:s page site, ies PTS> PE Nxe=es Scanned with CamScanner ee Te f ; ) Ps 2 pst 2 , 2 ps20F byley -veKR Pensa nh ade ing - Perfoornance of Raging: ') Teviporal tisue ¢tepack on Fone.” wa Cp =e reyred dala. from main memory PLE fain mentary OdCeHs bine be Sm’. RE addien, honghhan Kens (ovetheod due fo gaye ttle) dk oten We = The this Hoghpubdeccoiey loos oe nedute his overhesd “W vadng the Comer ot TLB TLR: Tranclation Look Ast oside Gate, (Logie) adders cache) TLR is similar to coche > TRecontaidt, previoutly " resolved" * vA! and: vk coveyponding pA D tee THR accen Hime bee’ Ce Wow & corespondiog ais fund i THR, ohh ake, ley access Hie, we dire ty use He. Corvespending PA bo access, \eguired dake ia the memory. 3 The eceat F finding required addvenin TLR is called TU8 hit: Here accem ime = CHM } > The event ft wnissing yeguied addvery iq TER YS called TR miss Wee acces Hme = C+2M Cole ‘am? halt paral! garch & orened 00) 118 aMd memory’) 4 8 A TUB hib volo x! iS pene Prachion of hil (ogres) Efeckie. Heron, accens fime with TH ao Hk vale =, 4 is no of references BH. me toons E> Ins ‘ 12-400 a: foamy ald 1” based 2 ; 8 a se oshmout TBR ka ee ony Effec. Meme AT> 2 (100) 22100 woke TLE TY 8 Be fens Ate 0 9(loeino)) toni(roarme’)” ” we 2 W692 Sra00l Cle Hat atts 18) FEL were tool. then yok ete. rem 47. eILMOS+ 0-9(920))= a10ng [moe Hon ish THE) Scanned with CamScanner rs PD Jro TLR ve sedis Logical address Howe ose phytitol caddies oo Goche- Afler Obtoinieg required PA we need fo access memory again. qo reduce. this we can, ute physical address cathe. Cenc Ge Physical adders cache Contains beth PA ond Corresponding dota. > with this now, accessiog taghuckeq ts. 18 BY say 65a * fH PA 1 {mom A Physi ds Cathe, Keath beare=nanbor paca mis thye Add Cache 7 i hie ; bey p 4 hie miss wong Fetch fem 4 ot z een meetory yeh etch fora “Ls ins. memory (oat Fath) (ovth eo) > let hit wtio ¢ THR oh fit ato & Pic > Xo aces Hine ot TLR = Cr aces Kime o Pho = Cp Hemnory access, Hime = Effectie memory accers fime with both TEE 4 PAC 2% (@ +t rae)Cevan)| +O) [ Ckm + Gt (x2) (10) | — fr PA (ms volid if wt) is wok tn-line Scanned with CamScanner wae nok Tn-line Cathe means oth TLE & P&C. ae independent cai Kr gyeine cathe means TLE £ PAC are dependent 4 a - 3 ey, whenever SE, Yemtove amt “by “From "TB (a4 Pa) the caapsing ey wa PAC (ri cn ‘axe digo yemoved - Tn Wits core FF TLR mins occurs then there & Ao mecd ty refer PAC Cuhich ould gurely be @ min) | Effechie memory acceas Fine with {TLE A PAC CEntine cacte)) wer ngce t 040) Cea] + (ex) [erin] * (oy default’ we somite consider nob. tale) EMAT,: D> Hk 4 OH) (kszm) —@ Ceram) aa er (ee tas) Cgc) cake @ = Cey-e2).Gierom) b-2 > (arta) [k-k-2m] (wt) Gaithak TER . EMAT? pram3y mie set z= both TLS . > 5 . EMAT= & aLer BY x (vn) (eed) 2 | WR HDE kre xD Scanned with CamScanner fe De, erD-? fe rz 2(k+D-2) D Ly Qe 32 aylRAS= 23> Ps, booed site = 4 bylea, - es Page table eahy Sites Abyley Cased) Ns cS = 2% poge, Sie B page bibles Nee > 4 cooads Hime seq ty \ood page table > gx loomsec joral porers quake = leomsec = (00 108 nsec » neq. fraction 2 Dx 34 0 ae -¥ Te sees Gey Sieh Dy B) Spatial Fase Cspare optimization) Assume LAsarbits 7 PS> kB >P Noyg 2 2° foge Hote se, PTS > 1H eahies xt e(PTES) ts 4 byly thea prs> ANB be1 Every proces wil hae a! faye table of 4HB SE igciat! dejnatle’ to hove larger page. tables, Se soe need bo reduce page fable size A a proced. Scanned with CamScanner Reducing dy Increase page Site PTs2 wre PTs AN => PTs Horsewer increasing Pg hoy iis oan draw backs A: Assume ue have a program of sie 1026 bya it Ps zor bytes hee we repuie 2 poge IM ahich we vse only 2 Kejles of am page eer Ttesnal Fragmentation = 1022 byley ib pss a byley then we require 513 poger- ter toternah Frogmentation FH Trwreesiegy FOYE sire increases internal Fragmentalion Go, now, we need b> Come up with an ophimal page size Lee VAS = S bytes b Ps= p bybo RTE 2 ce‘ byes *) PTs: BSVAS ypTE es > Tavesrol’ Fray enentaion” cin happen onlin the oat page. Scanned with CamScanner Tn the wont cue TE Could be alemost eguoh bo page side Avge TE = Plo a PARE dalle sie Ay Ip ae Cleasby overheads Z-opkimel page size ws such thak foral overhead & mio imum fey SEAR ig minimum mee - ophiowl page sie , P= Jase wirto overhead of PIs 2 Te Scanned with CamScanner eS, vas = 2'° sz 2* he 6 Pog Mewes 8 pay Udon > 5 PY I+ py Neue 2 4 PAS? a) doe, not Mt Scanned with CamScanner ete @ Pure Poe byby “ Nega2 2 os 2 paps > 1638y 7 feats DE oo pegs = 8412 daia> 16 386 = 4016S BS Hott Foges \orst ps Som > 18890 2 3967.5 > 3468 Pages 4 Thus for Psok bys, Pre Program fis b) Awome rela mox Possible page sine = a byl on 2 Spas, > ae gh pages fot: 22. oS ™ poses ae oe pges | wee] yes ¥ 2 - Py \ 2 (I 2 2aCe pea Scanned with CamScanner ae & Stroh por ust Wy 2 128-17 for x28 624 ba ee pb ued Bs 32-1 por e210 14 Wd ok = Hox poge site “Such that He program cold Ab 2 612 bytes gt diy Hashed Raging | Fogiag wth Heshieg sams dechnigquea helps reduce site of page table hota jisiea resolution Craig iechniqae) ooo 22142} felt --- (10) (for example ) Scanned with CamScanner Ta » alas. | HA LAs @ Says mare pussiple Process STEC- [forever ae we aa have Smaller erocersey. Tn His cose sine dt heth Pe fable, is vey Won tran Mormoh page table. for comee, tase 2272 448 (Bor goaciire poceii” sre) Comvia Ly necerah page table sie page yale” Be any process TS same, @ ‘Heame we have peees # pens op oid. fages = VS 2 ay b» , ae Re ie cil have only %, entries 1 However Mee-pa ovr page “able ho, 22° entries. => Howerer both pays table may reguive exha He “for “Searchieg rough the Usb So. hash page Fable space effeient bat not time ebhicient. ata, Trverted Paging | Reverse paging an Cis opie wil be Aisuuised in the ed) 2 Mulh-Level Dai | Vierarchical Paging «6 & the. awic Uabjechve ot multi le ae Skee ag 15 to vedas paige tole aie overhead. & Hyltilevel poging is ine on Pag “able. oe a + Paging generally involves 3 sleps 5) divide the Addvers gpace ia pes E> Store the pages nto Promes ct memory ily Access the pages at the adver, space Yhrough page cable. a Scanned with CamScanner for cure me + Stensider 04 a LaArsr bis . Ps aukR Bos Moga, = JS 1M Pes Assume sire, foge table enibry.a 4 ley §s wPTS2 BAB Hoo the page table gel ig moe tran Sire be one, page PT mask be goed da. MAB ie pages HR Bos we, ee “he fig a eae pie fable Coser pipe, ” oT tale’) tok ‘poaes in loner 2, A euler page dabode =, rex Abie page fable hey Rage enact : - “yee Pre per” ane . welityM 4 3 ue iets fa en Ge eos cwume we. hase a proces Ab sre to kB. e shee Scanned with CamScanner _ aonermal—page Amume rere 5 page OC Cr eae +2 dato + tehack) wy Ausume these 3 par me pan preett in & different location Gath Her code ts in 2 Conbiglog pages, dates, in 2 conkigions pages ond atk iM one page such that we need 3 pa d page table. (As, shown in the Faure) > koe ia de, at A valHiuel may te need cule | pogetable , ond the 3. pages ot inner page table for the execukion A the procenes. (rer > TE ve don't ue tale pogig then we oo oe hove alt Ut ‘entwes"p ‘oage “Fable ‘Cie veut wremor4, > Thos matted paging dus the overhead of age table | Bre Hyak S to lee shoved in main memory: | > Addrening: | 1 level paging, peel —pagins | do 8 heal Posing | Pate bye adders Prenat be 2 level paging i no ct ealpaies iq inner PT fi Ps of vAS (re dere) if is poe st sic sh nee pose able BLE lo 4 atria) a Scanned with CamScanner NVAt32 bik Sh k ue pf) Tier” PA (iicertiia’) cup aad ain merry ) . ae se) 4 Wee f m fae, # main. memory tm which , rae page. taner page table fs located. 2 Bes Frame of main memory i which veguied page 4 4 pmcea is goed . : . - for phoe obfsek “4 * uaed t obtain required word: ©) arm <— 2% dz oie 1d db > A Sites 224 kS Noyes 29 ve oN pages dl) be Avanslation ve need — -dulor pogetahle &L one page a iver page fable ia memory kl at (ay ee PRI 8.4 2 Scanned with CamScanner eyes BxHs = glea4 = 2s) 2 sirls) = 2860 bytes > 2+5kS tee | ce Reda mentory ccs pime > 3m withat TEE + sly Aye nleok poging cithout THE “BHAT = (nH )m ype eb bik > vase 2 TR PTES > Y byte = 2” le P22 ae ek Neng s 20 2 Te Bre bg leak poge. table = a ™ xge , git® bye tro A pogey in gd level poge tuble > BE cine of a" leek poye tuble = 2 to 4 poges in a ll pts so-2e z 2% 48a bg -2% boar pe WBE yr {50-1K a2=> 9° 50-3 z Scanned with CamScanner $3, Bie A st foal pore fables 68% qh 5 982% a gia Wot Sine Ba fuk gage table = he Pome. . 52-3e be, og aoe 2) SL-B¥> % Foe 22,8 “Page size 2 gS = ke leh Poge, table’ erie’ Sad K same ia oF all lets L pagg tables. nice wok PT eabiey in One page f page table ooo 4 nN TGFANE 1 Noptcal addiets Brat eh Dee Te idee atfset oh the ; Pome | ue ae Toitdee ino Te dee itl 7 (8 Main reewons oe Me WL PT gi [uk pe Scanned with CamScanner Hethed 2 : lee Lee of ‘he vege PS give de onter Ch (yp) PT 2* no eatin § PE 9% ght PrES & LAs 84 Plex imerieg ake BT, Ut gobo py A om Ivf pa eT En ho de erikricy 0 eer 0 fOIE a" lut PT= 2% 2 WEL B(n-2) EEE 2) 4er 52 22213 J sfage sites os 2s 8kS From the abdve quertion we Con ome ap wilh a general Serrmabes toe Pt with A level paging fain VAS: 2° byles 5 PS=2* bya; pre 22° byley sine # OPT “| ys Arlewd paying (with union pages at alt leely) Scanned with CamScanner & L: Seqmectation foging doer not presene users view of proprart cog segment) = se 42 vols + 2 ‘3e0| —sy = 50|— woz 1s | s * yo | 009 (200 2 AE vier vies progam 8 divided inks segment (each. segrent pry he sh ges ot eri, : A ditf sites), > Foch Seqrnent hoy gegenent: id- > differed segments 0 stored. fon-conkigunaly « However a . segment itsetf 1S shore totally at one locaukion Ccanhyuowly)) > Vere MMU: 18 .seqmant; table, Book . o | soo | 360 Sioar Brose address ube sepynent 1 Preto | 1800 b= lenghh at segment L[psoo | S00 3 [2 | 256 a (oo [10 1g }xo0 ]2000 yy wet > Brey process hos its oun segment dale’ oy ck ohn He Oe egret Haun eae coy Scanned with CamScanner . Gh foe deo eortle oa oe LAL 3eG0S —S PAC 200 +50) 2250 Bi egaassy L—(ass > 500%) mee 5 bap Lr | | Pedarmance ig Seqmentahion i Go Temporal tssumeinpatt on ne): : Gadly same os agi) Ce B® ~ EiATE 2m) withook TLE : ) ay we can Sad TEE 4 PAC (same. equation oy in the. ow £ psi & Spatial_ sue ' hey * Large seqment fable ts undesirable He ¥ One dt wos to edoce sine. oE * saya table iF i fo ote. paging on segment table. a " K hoote stm case oF Seqinentalion «we doa't divide, PAS - SPAS As. orqonined with variable parkkoning (Mvt) cublers fron external dockR ue Koos tok variable park Heniog Frogmentabion > To overcome this external Frgmentasn we- “aay ae . _ Compaction o aa : reducede Ye overcomes * sie db egret the poblem fable 7 of EF Scanned with CamScanner oS ONE — raleonah Frogrnentahid EF ~ External Frogmentahe) , Contec es Segment Fotsle eqnente “Case = Length uy den ° 2 Gon \ ee ty oy 2 4 to 2 Bw geo ‘aed ae 4 sage Uehal Be pygieal odadvexsy foe Following logical oddrerer a) ork30 vO - . * 219 + (430 -B) . 21g 43> 68 Guq Wo i ’ De FSESSY 2.200 tlo>, 2310 2800 { §00> 100 i J sbaP : 3) 3,409 1394 tleoo = 124 2) ane N29 96 : bap ~ Seymented ~ Yaging - > eto segment sires 2S = We bye ze pial toc caeh Segmnenls possible = 2° 256k Semone. Scanned with CamScanner oF To avoid EF we apply. paging 07 segment, i) Divide odddree space, Csegment) inks paggy’ : th Store theye Pages in Frames, 5 Ui Accery the ramey though Foye table Fo segment Lek page site alka, no & ino ent > SHAE. Gy POE fogey in a SAP Seqras “a= PE 5 Nos PAS contains Pramas bub rot seqrren's “bos the faye table + seprent cothaing an ethy foe each poe ob the segment > kos every segments must be aecened thvough ik Covesponding Page 4able || nye 63 t er a a sae yen (sues) od Page fabla > no A segmenls Ts wwe have 256K Pope tales. Shuchne 2 sepmente ‘able : 2 g L ' : ; Bo boxe, athe eno, : 186% cox icespondirg page be & set a (421 0 33s) . fhe segment aaok L let 4 rent Scanned with CamScanner ‘a legal adders ficmat we have. opplied poging on segmnete (te on dé F [sti Ka, V (Ed 7 no b-enhies in each page table B 6 10 sie A page. i say deck thin, the page Segment am Table hap page able us ae Haia mentary q ¥ tere ye need ty acces segment table, then conesponding gage table tren te required data. sey 3 mentary accenser Like in the Cae paging We can ise TLR fo veduce EHAT. Hee alse the TL& containg vat covvespondiog PA. Scanned with CamScanner | VaS= Pas= 2!6 byles> 6 8 to & Segments ja VAS= i te 9 ope size each Segmen 2 eo! = 8k L ¢ ” 7 aa) % table eh sees 2 bytes Lek poge Bites 2h, j Fi Po ge aoe jen i & Segment = no ot PY i. | "3 i : oe cee, no of erties in a PT> 2 hem tue Fre OAD AZ - given Site ee 1 Prome sr that - ve, gt ® 29% ey ust _. t 4 hayes = 128 Mylex ce eet j See Assume, seqnetotabe entry sire oh by Bs sre of Seyment table = 8xu4 > 32 bytes Scanned with CamScanner Vietual Mernory (vm): 2 UH given an illusion fo the Pregrammey that a huge amount ot rremory is available br executing larger programs in" small memtory ore, — al 7 re tsa fechnique that supports the gook a wraneging execution ot lavger programs ia gmall rmeniory area. > epy owumes thot it con execubey a program a big oy VAR. Scanned with CamScanner Hower PAS may mot be Gd big os VAS: So uz ceed Ip Store fe proyram on, disk. From disk Bue load required pages inte memory | 2 Somelime, reguired page May not be | core vequived page Ts tended into memory Is keno demand —pagin Demand gagicg : Loading page demona is Kroon a4 demand paging tee, Victva memocy is iepleme UM nfleenentation Ahough Demand Raging Ler yageekR > PASH AKRZ —-PszlkS ) a» NBS Het dio VAS ve a] s @-dx FS : 4 . ’s t | fe 15 whetrean He ey page & present {9 ” found in train memory. Tn that from the disks Ths fon dice te memory of vurkine Enged on ated +hrough demand pagiog- load (copy) Dist Gonlains ait et Af ‘Disk. cee abe memory Be not ts Fenda by volid [invalid Cu/z', bit ubich is i0 je poe table. TE vequived page 15 found in He wee then ik ts called page hit» FTE vepueed page is, nob, found in the menory then ik is Called page mins or pee At fault. paw tur-e poge fable Scanned with CamScanner » y + ™ | Ye fault sevice: J- Process that caused page Pult gets. blocked a Vilual memory manager. feu lasts vunnieg (in kernal mode). | Victuok wentony manager fells disk _managey Aboud which pe BL. | lagi eg 3+ Disk Horoges gommunteatey with device driver. We Denice deter meals the page (vou disk stared wand transhees “Yegiived page fo OS 4h taing DHA 5+ os will ty bo load the page im one ct the thames at Wer pocen: §- Th there Ts no emphy frame 'ts lead new page’ then virlual memory manager hex fp inihiate paye replacement though hich one dt the pager in mentary ts veplaced with veguired page Here we have 2 Cores: > page drat ts selected Ayy replacement i¢ not modified ron we tan divechly areconte ik usith Tes Page-CA dick opcaton) & Wik is wedihied Caicty page) then fre modified page box ty be Saved in the dick. Later the news paged is lnded Cire 2 disk operations) 7 APkr the new pye iS loaded we need 4d update foge a table Ca: changing viz. bit etee) 8 Unklock the wer process No when the process is scheduled again, it generates the same vA that it hod generated previously and continues | Ste exeaukton. | | Tiist vet inaplementabion Hrough demand i Scanned with CamScanner 5 page ult sewvice Ke Be kine taken to Service 0 page bath. . dence. - fis wsvice Hee reduces Ahvoagh pat fo werteed’ br xeduce page fault role . | > Vewand paging is ab a TYPAt o> | a efebred Deratd Pgiy j ine oe = = > Exeukion Starks with | > Exewkion darks with bing bes 00 ben Fag, io the. sash bac af yet Mo ain, memory . C84 defautts.we Lonsider pure demand, paging, ahile _ Sluing questions) The ce F vietual raemnory supported. ep is" evenly \imiled by ie ——_— ys ne" af die ( Secondaty ‘Goraye) Sm: iste: Bie veal Kime!’ jrnpleimentahions. gh virtual memory aed Scanned with CamScant ler Pechocenance A Vicuah Hemony ci) Temporal Issue; (time) ‘ASME main memory acces, hime = Sm page. fault service fine = *s' Y ( ¢ >55 mm) poe. fault rake = *p' (oper) page hit vale = 1-P EHAT df with = (ep)m + Ps fe Ss Woe don't uke see stm Demand paging Jn gencal pf fault Service Heme vray varge in wiltseconds. PEST = loms Hem. AT> IHS paje hit vole, P= 44-99. 0.9999 185 EMAT = eat) + 2-01 CIO KW) fg, “bo” 100 > Gye > 1-99 4 Too = 14999 HS ¥ ops e Heat e Ktia 4 (ag) - OOS inghacton Hime r Ker 2 ind Scanned with CamScanner | PEST = Ems (ewply fame oe unneited fore) some (odes fore) hem AT > loons @ page to he veplace 1s modded Fox of the time- weyuied ER EH AT 4 2000 nS Bm let phe pafe fit ve 7" %> lo6- 83-6 £2000 ne GMAT > CP) (io) + P(0-7 (rox me) +o-3 (2x10%)) p > te = oop +P( 4 moby 9-4 x 108) SHO IOP Ibe P Ki0s > (Be xO8 joo) P 4 4® r009 109 =) Cleuooo-1)GmF) < 1g00 pe 4 163999 wor acceptable. page fult vate = _lt 168999 (la) en AT =H. (oye hit) > D (pe fault) sore Boe Pprocess crate x uni. poe fault rae, p2 Scanned with CamScanner _cacsaanaasatttt X= QP) HF PO) xe Hone red > PCd-m) = a-M Pe woM D-H consideriog TLR & page Patt robe the effective memory Gacers Aime iS EMAT= x (crm) +(OO| (A) emst PRS ) aC 4 (yligible) x-hitrbo ot TB Po poe fault wale pye rpacement - plicien Page nefexence shi tor Tveleetde_sbig t + oek ot succenively unique pages releed in the given list ab viehul addrewes, Bs vast 5485+ RK oBh: 12%; . C402; 4557 8047 O84 7 I2%7 5607 468; Hz Biss 57 654) neg Lek page site = loo Also eal te above adlrenes arin dew decimal prye Po contains, adivene, 0 to 9 PR a « loo to 199 Page. number = lee) page ofhsele = VA +> PS Scanned with CamScanner 2s Reference Shiry fhe above vals iS fF C418 00,108, 4,400 1,6) (successive page numbers ave_uaigue)) Brey refeence hing hoy 9 puvometers » db lergth Cer to av above example) ; yo bungee pages (4B Co) (ier in chow cot) Frame Allocation ‘Plicied ” Assume ue have. / Wen & pees (R.. i) demand ob each procen Pr be S tot frames ord demand br amas y=g g tee road home arnilte be MCD oH). framed Allocated to pocen’P, “bea; Scanned with CamScanner eS a Gh alocakion Fey , Grey peters GAS eal no of frame Ban Frames, -— © Propectioral allacahon 1 A Frames dlecated & proporkerah by sire jer Soxn tod frame for proces P Orso. whe Brey prces is given 1 # He frames tt has demandeds Tis 1 ts choosen aged on rain tmemory, cine. and other Soclors, Page Raper’ Techniques (pre dem pig by Jehu) Consider for & preceas nelowrce Sieg EF; 0715 2) 00 3/Orley D/O B/D LOM, F041 length of veference steiog =O 4 22.0 ‘no ot unique PAYA , n> 6 eit | So Aros | fecume no at frames dilocate forthe process = 3, sed on the time ud loaded we lace from obove. ca vet have 15 page falls page fault we = 38 sos Scanned with CamScanner sh ve inbreae 0 A Rame allocale page fully decreses vist C | rod arigne wd > scolerences, Prarie TH no A Promes allocated = 4 Fer ue + yo zal a0 peye faults page fault vate = ©. og 50 Rel seiog A C0208 ae DES Bed re SY Aete : A ae N25 (unig vet) no & fame diet > 3 Ee 2.9, poje aes Py faults vale, = boots © no ot fram dllocaked =4 784 zrs | page fully > ‘Goepess Pe fal wate = 10, og Scanned with CamScanner & ay gn this example we got more poge Faull, uit more, no oF frames which ts an OMartoly. This 1s known Bedadys anamoly swith increase in vo ot b framey to He process , He # page fault vale (ncxuser, > Bladfs Anomoly ts clsened only in FIFO 4 FIFO aed replacement . 4) dphimal replacement: optinod replacement Soups tae replace thal Pye chide will wor be Gaede Leogek “duration of Kee (a hee Pulure efeences. re SNL Hot, COBO BI SO18 (DNs Lp Oil HOLT + ahame : 1Bpons, Kee 24 pge fail, Scanned with CamScanner Reb shag QL be ete gee elesD On shong : 4 ) page hulls 26 + ophial, vplocewent gener hes the leat page Ault rte | Drauskack » 45 Ophea gage replacement is not poetically imglemeitiable Bae we Can News kendo the Aehse references 9 booenes Hes Can ke wed 0 benchmark fh medsure the pedorwance af other algorithms. | D Leak Recertly sed (1F9): mr ipu e replaces thar Bb Page ehich hean’t been yeheced Ae He longest dacarton ot Heme in the ‘pox: segelechon Crifevias Time a relexence. "Scanned with CamScanner % Reb AG! CF,06,210/3,0, Hi, 014,40 LONE TIONED a home, + ano dé eye alls = 12. 4 Frames» FEF oO aKN L ene A page pulse P >) Hest Recery Used (Hav) w Most recently used Paye is neplaced Reb-shieg £4011 /U O13 eBeke (2B 10/3/21, DOM OY, oe 8 bow, eno & page fou $hs = 12. Scanned with CamScanner 5) Couabieg Algovidhas. to ' 1 LRU HFU + (lease Frequenly Wed) Hest Frequent Used ) ke Fequency means no & fine the page is rehren refered ; «Cit, Cur load an bE into memory. Cit Fux ei hey me oe prevcoualy we Gtart in count from 0) H FIFO mtoy ee used le? fo rade A OM Hick Ree : Rebasreing : $.011,2¢ 063 Orb E13, O, Bedi, LeOed BOND HEV’ wom Pre xi) Eno ob page falls = 1 Scanned with CamScanner 4 fame eo LEU: rw + gage fouls = HEY > Pe “ Frackiably Ley hay ‘been fund fo give less paye dali (ives beat performace nce 4 chse te ophional) Tmgementakion gt LRU: 7 | ee H Yere we need fo monitor tme of rekience CTR) Thee axe Ire methods to monitor time reference & Gualer method 2 >” wr’ LCP UNE + - we moiMain a Courter register which 1s increamen te at every clock pulse. where whenever we refer a page We anign the Value A counter oy time ob ve ference foc Yrak page. Iaitvah value A coatler is 0. By Scanned with CamScanner \ieniraion « q ‘ sha abit Gunter Can Cure only aM values terete Gs Coyot Gals om d+ TL Guat goes “7 hy | Me. akgor'stiea Pass a : db Sack rected rhee we use a Stack iat ahih we pah Cvrery neu Page we replace- a aeplacement , we need to replace oith He a at the Hime feos recently uxd page This poge is present at de P out alk He bobion af tre ack: Ths ve need fo ‘Pe again (except, bottorr elerent) 33a page hit occurs + then the refered place. somewhere in the riddle? a the metit hoy fobe onto bb te bP element and push them right Ppresent stack. This ele! te stack. for akich we, TEA Need. je perform posh POP. Spears aoin- Aayoalage + EUAltee Counter method , Th works good in any Coe, Disedartae : & pan * Pep operation requires more time. {Ru Approximahins = . + 1Ru approxieationg ave. the Clan dF vel pretend fo work like LRO- bey they approximate. 45 He tehaviewr Of LRU lacement Jechniqyues Hak we hove b+ypes dd LRU oppreaimahins Scanned with CamScanner & Rekrence bit-Ce): —— ©: paye ot refered So far during Presett epoch K 1 pages refered sucker atlenkcone 60 fay curing present epoch - Consider belas page table % fone | vip | Tob! @ ofa cl2 [i (f & Peta To ; em = [-]° §Agading me l Tac (tobe Tre, b elecence afra_ fo v steels 4 not yefered in tHe presen epoch 3 [+ to | (moni Fy table. pn Time is divided ints equal intemal and each interval is called an ‘epoch. | when an epsch Is finished al the ‘Ré values ave cleared. ath page hit curs , Hen seb 'R! ot He conespording page table entry: 3th page fault occurs, i, Sat searchiey bse Reo on the ht catey heke ° ave veplace the frst encountered entry forresponding page y D TE A values one be oll He page then the alegorthm fails *& owrcome sn this Vmitakon Le use. werk: LRO “Approeimahion hich is additonal reference bik ashes Scanned with CamScanner

You might also like