Home Tekniikka Virtuaalinen muisti

Virtuaalinen muisti



Function

ThefunctionofvirtualmemoryThememoryplaysaveryimportantroleinthecomputer.Alltheprogramsrunninginthecomputerneedtobeexecutedthroughthememory.Iftheexecutionoftheprogramislargeormany,thenWillcausethememorytorunout.Inordertosolvethisproblem,thevirtualmemorytechnologyisusedinWindows,thatis,apartoftheharddiskspaceisusedasmemory.Whenthememoryisoccupied,thecomputerwillautomaticallycalltheharddiskasthememorytorelievethetensionofthememory.Forexample,ifthecomputerhasonly128MBofphysicalmemory,whenreadingafilewithacapacityof200MB,arelativelylargevirtualmemorymustbeused.Afterthefileisreadbythememory,itwillbestoredinthevirtualmemoryfirst.Afterwaitingforthememorytostoreallthefilesinthevirtualmemory,thefilesstoredinthevirtualmemorywillbereleasedtotheoriginalinstallationdirectory.

Settings

Thevirtualmemorysettingsmainlysettwopointsforvirtualmemory,namelymemorysizeandpaginglocation,memorysizeistosettheminimumandmaximumvirtualmemory;andpagingThelocationistosettheharddiskspaceinthepartitionthatthevirtualmemoryshoulduse.Forthememorysizesetting,howtogettheminimumandmaximumvalues?Youcangetitbythefollowingmethod:select"Start→Programs→Accessories→SystemTools→SystemMonitor"(ifnotinthesystemtools,youcaninstallitthroughtheWindowsinstallerin"Add/RemovePrograms")toopenthesystemmonitor,Andthenselect"Edit→AddItem",select"MemoryManagementProgram"inthe"Type"item,andselect"SwapFileSize"inthelistontheright.Inthisway,asyouoperate,thefluctuationoftheexchangefilevaluewillbedisplayed.Youcanopenthefrequentlyusedprograms,andthenusethem,thenchecktheperformancevalueinthesystemmonitor,becausetheusereverytimeThesituationwhenusingacomputerisdifferent.Therefore,itisbesttomonitortheswapfileforalongtimetofindthevaluethatbestmatchesyourswapfile,soastoensurestablesystemperformanceandkeepitinthebeststate.Afterfindingthemostsuitablerangevalue,whensettingthevirtualmemory,right-click"MyComputer"andselect"Properties"topopupthesystempropertieswindow,selectthe"Performance"tab,andclickthe"VirtualMemory"buttonbelowtopopupInthevirtualmemorysettingwindow,clickthe"Usersspecifyvirtualmemorysettings"radiobutton,selectthepartitionwithlargerfreespacefor"HardDisk",andthenentertheappropriaterangevalues​​inthe"Minimum"and"Maximum"textboxes.Ifyoufinditalittletroublesometousethesystemmonitortogetthemaximumandminimumvalues,youcanchoose"LetWindowsmanagevirtualmemorysettings"here.

Säädä sivutussijainti

Windows9:n virtuaalisen muistin tallennussijainti on itse asiassa virtuaalinen muistitiedosto (tunnetaan myös vaihtotiedostona)Win386.swpstallennettunaCdriven päähakemistoon. Sen tallennuspaikka voi olla missä tahansa osiossa. ionavaamallaSystem.ini(underC:\Windows)-tiedoston Notepadissa.Muuta[386Enh]-osiossa"PagingDrive=C:WindowsWin386. swp"muiden osioiden polulle.Jos laitat vaihtotiedostonD:,muuta"PagingDrive=D:Win386.swp",kutenVoit kirjoittaa sen suoraan ilman yllä olevaa ilmoitusta. Windows 2000:lle ja WindowsXP:lle voit valita"Asetukset→Advanced→Advanced"in"VirancePana"s"d"muutos" todellinenmuistinasetusikkuna ja aseman oletusarvoisesti valittu järjestelmä[taltiomerkki]Jos haluat vaihtaa osiota, jossa se sijaitsee, sinun on ensin asetettavaalkuperäinen osio sivutustiedostoon, ja valitse sitten muut osiot.

Ifyourharddiskislargeenough,pleaseopen"System"in"ControlPanel",open"VirtualMemory"inthe"Performance"option,andselecttheseconditem:user-definedThevirtualmemorysettingpointstoalessusedharddisk,andsetsthemaximumandminimumvalues​​toafixedvalue,whichisabouttwicethesizeofthephysicalmemory.Inthisway,whenthevirtualmemoryusestheharddisk,itdoesnotneedtoaccommodatethedifferencebetweenlargeandsmall,butusesafixedspaceasthevirtualmemorytospeeduptheaccessspeed.Thesettingofvirtualmemoryisbestperformedafter"diskdefragmentation",sothatthevirtualmemoryisdistributedinacontinuous,non-fragmentedfilespace,whichcanplayabetterrole.

Käyttötaidot

Virtuaalimuisti käyttää taitoja

Fortheproblemofhowtosetvirtualmemory,Microsofthasprovideduswithanofficialsolution.Forgeneralcases,Werecommendthefollowingsettingmethod:

(1)Aseta sivutiedosto osioon, jossa Windows-järjestelmä sijaitsee.Tiedoston koko määräytyy järjestelmäasetuksistasi.Tietokoneen asetusmenetelmätseuraavat:Avaa"Ominaisuudet"-asetusikkuna"MyComputer",vaihda"Advanced"-välilehteen,jain"kirjoita"kirjoitus"y"kokonaisuuden"uudelleenikkunaan" uuse"Ei mitään", aseta sivun tiedoston koko noin2 Mt.Jos käytät"ydinmuistia"ja "fullmemorystorage", aseta sivutiedoston arvosuuremmaksi arvoksi, joka on melkein sama kuin fyysinen muisti.

Smalltip:Thereisacontradictionbetweenwhethertosetthepagefileinthesystempartition:ifitisset,thesystemmayfrequentlyreadthispartofthepagefile,therebyincreasingtheloadonthetrackwherethesystemdiskislocated,butIfitisnotset,whenthesystemhasabluescreenofdeath(especiallyaSTOPerror),thedumpfile(Memory.dmp)cannotbecreated,soprogramdebugginganderrorreportingcannotbeperformed.Sothecompromiseistosetasmallerpagefileonthesystemdisk,aslongasitisenough.

(2)Createaseparateblankpartition,setvirtualmemoryinthepartition,theminimumvalueissetto1.5timesthephysicalmemory,themaximumvalueissetto3timesthephysicalmemory,thepartitionisdedicatedtostoragePagefile,donotstoreanyotherfiles.Thereasonwhyaseparatepartitionisusedtosetvirtualmemoryismainlybasedontwoconsiderations:First,becausetherearenootherfilesonthepartition,thepartitionwillnotgeneratediskfragments,whichcanensurethatthedatareadandwriteofthepagefileisnotaffectedbythedisk.Fragmentationinterference;second,accordingtoWindows'memorymanagementtechnology,Windowswillgiveprioritytotheuseofthepagefileonthepartitionthatisnotfrequentlyaccessed,whichalsoreducesthechanceofreadingthepagefileinthesystemdisk,Whichreducesthepressureonthesystemdisk.

(3)Nopagefileissetforotherharddiskpartitions.Ofcourse,ifyouhavemultipleharddrives,youcancreateapagefileforeachharddrive.Whentheinformationisdistributedonmultiplepagefiles,theharddiskcontrollercanperformreadandwriteoperationsonmultipleharddisksatthesametime.Inthisway,thesystemperformancewillbeimproved.

Muistutus:

Theminimumvalueofvirtualmemorythatcanbesetis2MB,andthemaximumvaluecannotexceedtheremainingspaceofthecurrentharddisk,anditcannotexceedthememoryaddressingrangeofthe32-bitoperatingsystem.--4GB.

Aiheeseen liittyvä

Virtuaalimuisti

virtuaalimuisti

Atypeofstorageusedtoprovideuserswithgreaterrandomaccessspacetechnology.Itusesacombinationofmemoryandexternalmemory.Itseemsthatthereisaninternalmemorywithahugecapacity.Theworkingspeedisclosetothatofthemainmemory,andthecostperbitissimilartothatoftheauxiliarymemory,formingamulti-levelstoragesysteminthewholemachine.

Thesourceofthevirtualmemorycomesfromtheconceptofthefirst-levelmemoryoftheBritishATLAScomputer.Themainmemoryofthissystemisa16Kwordmagneticcorememory,butthecentralprocessingunitcanaddressthemainmemorywitha20-bitlogicaladdress.By1970,theAmericanRCAcompanysuccessfullystudiedvirtualmemorysystems.IBMfullyadoptedvirtualstoragetechnologyontheIBM370systemin1972.Virtualmemoryhasbecomeaveryimportantpartofcomputersystems.

Virtualstorageisautomaticallyrealizedbythehardwareandoperatingsystemtoscheduleandmanagestorageinformation.Itsworkingprocessconsistsof6steps:①Thelogicaladdressofthecentralprocessingunit'saccesstothemainmemoryisdecomposedintogroupnumberaandgroupaddressb,andthegroupnumberaisconvertedtotheaddress,thatis,thelogicalgroupnumberaisusedasanindex,andtheaddressconversionischecked.Tabletodeterminewhetherthegroupofinformationisstoredinthemainmemory.②Ifthegroupnumberisalreadyinthemainmemory,goto④;ifthegroupnumberisnotinthemainmemory,checkwhetherthereisafreeareainthemainmemory,ifnot,transferatemporarilyunusedgrouptosendTotheauxiliarystorage,inordertotransferthisgroupofinformationintothemainstorage.③Readthedesiredgroupfromtheauxiliarystorageandsendittothefreeareaof​​themainstorage,andthenregisterthefreephysicalgroupnumberaandlogicalgroupnumberaintheaddressconversiontable.④Readthephysicalgroupnumberacorrespondingtothelogicalgroupnumberafromtheaddressconversiontable.⑤Getthephysicaladdressfromthephysicalgroupnumberaandthebyteaddressbinthegroup.⑥Accessnecessaryinformationfromthemainmemoryaccordingtothephysicaladdress.

Therearethreetypesofschedulingmethods:paged,segmented,andpaged.Pageschedulingistodividethelogicalandphysicaladdressspaceintofixed-sizepages.Themainmemoryisnumberedinpageorder,andeachindependentlyaddressedprogramspacehasitsownpagenumbersequence.Byschedulingthepagesoftheprogramintheauxiliarymemory,thepagesoftheprogramcanbediscretelyloadedintodifferentpagepositionsinthemainmemory.Correspondingretrieval.Theadvantageofpageschedulingisthatthefractionofpagesinthepageissmall,thepagetableistransparenttotheprogrammer,theaddresschangesquickly,andtheloadingoperationissimple;thedisadvantageisthateachpageisnotanindependentmoduleoftheprogram,anditisinconvenienttoprotecttheprogramanddata.Segmentschedulingistodividetheaddressspaceaccordingtothelogicalstructureoftheprogram.Thelengthofthesegmentisarbitraryandallowedtoextend.Itsadvantageisthatiteliminatesmemoryfragments,iseasytoimplementstorageprotection,andisconvenientforprogramdynamicassembly;thedisadvantageisthattheloadingoperationiscomplicated..Combiningthesetwomethodsconstitutessegmentpagescheduling.Insegmentpagescheduling,thephysicalspaceisdividedintopages,theprogramissegmentedbymodules,andeachsegmentissubdividedintopagesassmallasthephysicalspacepage.Segmentpageschedulingcombinestheadvantagesofsegmentandpagescheduling.Thedisadvantageisthatitincreasesthecostofthehardwareandthesoftwareismorecomplicated.Mostlargegeneral-purposecomputersystemsusesegmentpagescheduling.

Korvaamismenetelmä

Satunnaisalgoritmi

Käytä ohjelmistoa tai laitteistoa satunnaislukugeneraattoria määrittääksesi korvaava sivu.

First-in-first-out

Ensimmäinen päämuistiin siirretty sivu korvataan ensin.

Vähiten käytetty algoritmi

Korvaa pisimpään käytetyt sivut.

VirtualandRealAddress

1.RealaddressandvirtualaddressTheaddressusedbyuserswhenprogrammingiscalledvirtualaddressorlogicaladdress,andthecorrespondingstoragespaceiscalledvirtualmemoryspaceorlogicAddressspace;theaccessaddressofthecomputer'sphysicalmemoryiscalledtherealaddressorphysicaladdress,andthecorrespondingstoragespaceiscalledthephysicalstoragespaceormainmemoryspace.Theprocessofconvertingavirtualaddresstoarealaddressbyaprogramiscalledprogramrelocation.

2.Virtuaalimuistin käyttöprosessi

Theuserprogramofthevirtualmemoryspaceisprogrammedaccordingtothevirtualaddressandstoredintheauxiliarymemory.Whentheprogramisrunning,theaddressconversionmechanismtransfersapartoftheprogramintotherealmemoryaccordingtotherealaddressspaceallocatedtotheprogramatthattime.Whenfetchingeachmemory,firstdeterminewhetherthepartcorrespondingtothevirtualaddressisinrealmemory:ifitis,thenperformaddressconversionandusetherealaddresstoaccessthemainmemory;otherwise,accordingtoacertainalgorithm,schedulepartoftheprogramintheauxiliarymemoryintoMemory,andthenaccessthemainmemoryinthesameway.Itcanbeseenthatthevirtualaddressspaceofeachprogramcanbemuchlargerthantherealaddressspace,oritcanbemuchsmallerthantherealaddressspace.Theformercaseisforthepurposeofincreasingstoragecapacity,andthelattercaseisforthepurposeofaddressconversion.Thelatterusuallyappearsinmulti-userormulti-tasksystems:therealmemoryspaceislarger,andasingletaskdoesnotrequirealargeaddressspace,andasmallervirtualmemoryspacecanshortenthelengthoftheaddressfieldintheinstruction.

Heterogeneoussystem

Fromtheconceptofvirtualmemory,itcanbeseenthattheaccessmechanismofmainmemory-auxiliarymemoryissimilartothatofcache-mainmemory.Thesearetwolevelsinathree-levelstoragesystemcomposedofcachememory,mainmemoryandauxiliarymemory.Betweencacheandmainmemoryandbetweenmainmemoryandauxiliarymemory,thereareauxiliaryhardwareandauxiliarysoftwareandhardwarerespectivelyresponsibleforaddressconversionandmanagement,sothatalllevelsofmemorycanformanorganicthree-levelstoragesystem.Cacheandmainmemoryconstitutethememoryofthesystem,andthemainmemoryandauxiliarymemoryrelyonthesupportofauxiliarysoftwareandhardwaretoformvirtualmemory.

Kolmitasoisessa tallennusjärjestelmässä välimuistin päämuistin ja päämuistin lisämuistin kahdella tallennustasolla on monia samankaltaisuuksia:

(1)Thestartingpointisthesame:bothItisahierarchicalstoragesystemconstructedtoimprovetheperformance-to-priceratioofthestoragesystem.Theyalltrytomaketheperformanceofthestoragesystemclosetothehigh-speedstorage,whilethepriceandcapacityareclosetothelow-speedstorage.

(2)Theprincipleisthesame:bothusetheprincipleoflocalitywhentheprogramisrunningtotransfercommonlyusedinformationblocksfromarelativelyslowandlarge-capacitymemorytoarelativelyhigh-speedandsmall-capacitymemory.

Tallennusjärjestelmä

Butthetwostoragelevelsofcache-mainmemoryandmainmemory-auxiliarymemoryalsohavemanydifferences:

(1)FocusDifference:CachemainlysolvestheproblemofthespeeddifferencebetweenmainmemoryandCPU;intermsofimprovingtheperformance-priceratio,virtualmemorymainlysolvestheproblemofstoragecapacity,andalsoincludesstoragemanagement,mainmemoryallocation,andstorageprotection.(2)Thedatapathisdifferent:ThereisadirectaccesspathbetweentheCPUandthecacheandthemainmemory,andthemainmemorycanbedirectlyaccessedwhenthecachemisses;thereisnodirectdatapathbetweentheauxiliarymemoryandtheCPUonwhichthevirtualmemorydepends.Whenthemainmemoryismissed,itcanonlybesolvedbypaging,andtheCPUwilleventuallyneedtoaccessthemainmemory.

(3)Thetransparencyisdifferent:themanagementofthecacheiscompletelycompletedbythehardware,whichistransparenttoboththesystemprogrammerandtheapplicationprogrammer;whilethevirtualmemorymanagementiscompletedbythesoftware(operatingsystem)andthehardwaretogether,becausethesoftwareThevirtualstorageisnottransparenttothesystemprogrammerwhoimplementsstoragemanagement,butonlytransparenttotheapplicationprogrammer(segmentandpagemanagementare"translucent"totheapplicationprogrammer).

(4)Thelossatthetimeofamissisdifferent:theaccesstimeofthemainmemoryis5-10timesthatofthecache,andtheaccessspeedofthemainmemoryisusuallyfasterthanthatoftheauxiliarymemoryThespeedisthousandsoftimesfaster,sotheperformancelossofthesystemwhenthemainmemoryismissedismuchgreaterthanthelosswhenthecacheismissed.Thekeyproblemstobesolvedbythevirtualmemorymechanism(1)Schedulingproblem:Decidewhichprogramsanddatashouldbetransferredtothemainmemory.(2)Addressmappingproblem:Whenaccessingthemainmemory,thevirtualaddressischangedtothephysicaladdressofthemainmemory(thisprocessiscalledinternaladdressconversion);whentheauxiliarymemoryisaccessed,thevirtualaddressischangedtothephysicaladdressoftheauxiliarymemory(thisTheprocessiscalledexternaladdressconversion)inordertochangepages.Inaddition,issuessuchasmainmemoryallocation,storageprotection,andprogramrelocationmustberesolved.

(3)Vaihtoongelma: Päätä, mitkä ohjelmat ja tiedot siirretään poispäämuistista.

(4)Päivitysongelma:Varmista päämuistin ja lisämuistin johdonmukaisuus.

Underthecontroloftheoperatingsystem,hardwareandsystemsoftwaresolvetheaboveproblemsforusers,thusgreatlysimplifyingapplicationprogramming.

Sivupohjainen ajoitus

1. Sivupohjainen virtuaalimuistiosoitekartoitus

Inapage-basedvirtualstoragesystem,thevirtualaddressspaceisdividedintopagesofequallength.Theyarecalledlogicalpages;themainmemoryspaceisalsodividedintopagesofthesamesize,calledphysicalpages.Correspondingly,thevirtualaddressisdividedintotwofields:thehighfieldisthelogicalpagenumber,andthelowfieldisthepageaddress(offset);theactualmemoryaddressisalsodividedintotwofields:thehighfieldisthephysicalpagenumber,andthelowfieldisthepageInternaladdress.Thevirtualaddress(logicaladdress)canbeconvertedintoaphysicaladdressthroughthepagetable.Inmostsystems,eachprocesscorrespondstoapagetable.Thereisanentrycorrespondingtoeachvirtualmemorypageinthepagetable.Thecontentoftheentryincludestheaddress(physicalpagenumber)ofthemainmemorypagewherethevirtualmemorypageislocated,andavalidbitindicatingwhetherthelogicalpagehasbeentransferredintothemainmemory.Whentheaddressischanged,thelogicalpagenumberisusedastheoffsetaddressinthepagetabletoindexthepagetable(thevirtualpagenumberisregardedasthesubscriptofthepagetablearray)andthecorrespondingphysicalpagenumberisfound,andthephysicalpagenumberisusedasthehighfieldoftheactualmemoryaddress,Andthenspliced​​withtheoffsetinthepageofthevirtualaddresstoformacompletephysicaladdress.Moderncentralprocessingmachinesusuallyhavespecializedhardwaretosupportaddresstranslation.

2.Conversionback-upbuffer

Sincethepagetableisusuallyinthemainmemory,evenifthelogicalpageisalreadyinthemainmemory,itmustbeaccessedatleasttwiceinthephysicalmemorytoachieveoneMemoryfetch,whichwilldoubletheaccesstimeofvirtualmemory.Inordertoavoidanincreaseinthenumberofaccessestothemainmemory,asecondarycachecanbeimplementedonthepagetableitself,andthemostactivepartofthepagetableisstoredinahigh-speedmemorytoformafasttable.Thishigh-speedstorageunitdedicatedtothepagetablecacheisusuallycalledatranslationlook-asidebuffer(TLB).Thecompletepagetablestoredinmainmemoryiscalledtheslowtable.

3.Sisäsivutaulukko ja ulkosivutaulukko

Thepagetableisaconversiontablefromthevirtualaddresstothemainmemoryphysicaladdress,usuallycalledtheinnerpagetable.Correspondingtotheinnerpagetableistheouterpagetable,whichisusedfortheconversionbetweenthevirtualaddressandtheauxiliarymemoryaddress.Whenthemainmemorylacksapage,thepagingoperationmustfirstlocatetheauxiliarymemory,andthestructureoftheouterpagetableiscloselyrelatedtotheaddressingmechanismoftheauxiliarymemory.Forexample,fordisks,theauxiliarystorageaddressincludesthediskdrivenumber,headnumber,tracknumber,andsectornumber.

Segmenttien ajoitus

Segmentoi virtuaalinen tallennusjärjestelmä

Segmentsareareasthatcanbedynamicallychangedaccordingtothelengthoftheprogram’snaturalboundaries.Generally,programmersdividedifferenttypesofdatasuchassubroutines,operands,andconstantsintodifferentsections,andeachprogramcanhavemultiplesectionsofthesametype.Inthesegmentvirtualstoragesystem,thevirtualaddressiscomposedofthesegmentnumberandtheaddress(offset)withinthesegment.Theconversionfromvirtualaddresstorealmainmemoryaddressisrealizedthroughthesegmenttable.Eachprogramsetsupasegmenttable,andeachentryinthesegmenttablecorrespondstoasegment.Eachtableentrycontainsatleastthefollowingthreefields:(1)Validbit:Indicatewhetherthesegmenthasbeentransferredtotheactualmemory.

(2)Startaddressofparagraph:Indicatethefirstaddressoftheparagraphintheactualmemorywhentheparagraphhasbeentransferredintotheactualmemory.

(3)Lengthofsection:Recordtheactuallengthofthesection.Thepurposeofsettingthesegmentlengthfieldistoensurethatwhenaccessingtheaddressspaceofacertainsegment,theaddressinthesegmentwillnotexceedthelengthofthesegment,causingtheaddresstocrosstheboundaryanddestroyothersegments.

Thesegmenttableitselfisalsoasegment,whichcanexistinauxiliarystorage,butgenerallyresidesinmainmemory.

Segmentaalisella virtuaalimuistilla on monia etuja:

①Segmentin logiikkariippuvuus tekee sivustosta helppoa kääntää, hallita, muokata ja suojata, ja se on myös kätevä usean ohjelman jakaminen.

②Thesegmentlengthcanbedynamicallychangedaccordingtoneeds,allowingfreescheduling,inordertoeffectivelyusethemainmemoryspace.

Segmentaalisella virtuaalimuistilla on myös joitain haittoja:

①Becausethelengthofthesegmentisnotfixed,themainmemoryspaceallocationismoretroublesome.

②Itiseasytoleavemanyexternalfragmentsbetweensegments,resultinginadecreaseinstoragespaceutilization.

③Sincethesegmentlengthisnotnecessarilyanintegerpowerof2,itisnotpossibletosimplyusethelowestbinarybitsofthevirtualaddressandtherealaddressastheoffsetwithinthesegmentlikethepagingmethod,andcombineitwiththesegmentnumberFordirectsplicing,anadditionoperationmustbeusedtoobtainthephysicaladdressbysummingthestartaddressofthesegmentandtheoffsetwithinthesegment.Therefore,segmentstoragemanagementrequiresmorehardwaresupportthanpagestoragemanagement.

Segmentpagescheduling

Segmentpagevirtualmemoryisacombinationofsegmentvirtualmemoryandpagevirtualmemory.Theactualmemoryisdividedintopagesequally.Eachprogramissegmentedaccordingtothelogicalstructure,andeachsegmentispagedaccordingtotheactualpagesize.Theprogramiscalledinandoutbypage,butitcanbeprogrammed,protectedandsharedbysegment.Itdividestheprogramintologicalunits,andthendivideseachsectionintofixed-sizepages.Thetransferoftheprogramtothemainmemoryiscarriedoutaccordingtothepage,butitcanalsobesharedandprotectedaccordingtothesegment,andhastheadvantagesofboththepagetypeandthesegmenttype.Thedisadvantageisthatitrequiresmultipletablelookupsduringthemappingprocess.Inthesegment-pagevirtualstoragesystem,eachprogramislocatedthroughasegmenttableandasetofpagetables.Eachentryinthesegmenttablecorrespondstoasegment,andeachentryhasapagetablestartingaddresspointingtothesegmentandthecontrolprotectioninformationofthesegment.Thepagetableindicatesthepositionofeachpageofthesegmentinthemainmemory,andstatusinformationsuchaswhetherithasbeenloadedormodified.Iftherearemultipleusersrunningonthemachine,eachchannelofthemulti-programrequiresabasenumber,whichindicatesthestartaddressofthesegmenttableoftheprogram.

Virtuaaliosoitteen muoto on seuraava:

Perusnumero

Segmenttinumero

Sivunumero

Sivun sisäinen osoite

Conversionalgorithm

Virtuaalimuistiosoitteenmuunnolla on periaatteessa kolmenlaisia ​​virtuaalimuistin työskentelymenetelmiä: täysi assosiaatiomuunnos, suoramuunnos ja ryhmäfyysinen muunnos. Tapa, jollakukin looginen tilasivunmuunnos voidaanmuuttaa kokonaan. icalspace-sivua voidaan muuntaa vaintietyksi fyysisen tilan sivuksi kutsutaan suoraksi muunnokseksi.Ryhmäassosiatiivinen muunnos viittaa ryhmien väliseen suoriin muunnoksiin ja ryhmän sivujen väliseen täysimääräiseen assosiatiiviseen muunnokseen. Korvaussääntöä käytetään määrittämään, mikä osapäämuistinosastakorvaa iliarymemory.On olemassa 4 yleistä korvausalgoritmia.①Satunnaisalgoritmi: käytä ohjelmistoa tai laitteistoa satunnaislukugeneraattoria määrittääksesi korvattavan sivun.

②First-in-first-out:Ensimmäinen päämuistiin siirretty sivu korvataan ensin.

③Vähiten käytetty algoritmi: Vaihda pisimpään käytetyt sivut.

④Optimalalgorithm:Replacethepagethatisusedafterthelongesttime.Thisisanidealizedalgorithm,whichcanonlybeusedasastandardtomeasuretheprosandconsofvariousotheralgorithms.

Theefficiencyofvirtualmemoryisanimportantcontentofsystemperformanceevaluation.Itisrelatedtofactorssuchasmainmemorycapacity,pagesize,hitrate,programlocalityandreplacementalgorithm.

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP