Home Техника Виртуална памет

Виртуална памет



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.

Коригирайте позицията за страниране

Позицията за страниране на виртуалната памет на Windows9 е всъщност файл с виртуална памет (известен също като файл за разместване) Win386.swps, запазен в главната директория на компактдиска. Местоположението му за съхранение може да бъде всеки дял. Ако капацитетът на системния диск C е ограничен, можем да прехвърлим Win386.sw към друга част чрез отваряне на файла System.ini(под C:\Windows) в Notepad. В секцията [386Enh] променете „PagingDrive=C:WindowsWin386. swp"към пътя надруги дялове. Ако поставите файла за размяна в D:,променете го на"PagingDrive=D:Win386.swp",като напримерМожете да го въведете директно без горната инструкция.За Windows2000 и WindowsXP можете да изберете"Настройки→Разширени→Промяна"в"Контролен панел→Система→Разширени→Производителност"отворете прозорецът за настройка на виртуалната памет и системата е избрана по подразбиране в диска [етикет на том] Ако искате да промените дяла, където се намира, трябва първо да зададете оригиналния дял във файла за пейджинг, и след това изберете други дялове.

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.

Usekills

Virtualmemoryusekills

Fortheproblemofhowtosetvirtualmemory,Microsofthasprovideduswithanofficialsolution.Forgeneralcases,Werecommendthefollowingsettingmethod:

(1) Задайте файла на страницата в дяла, където се намира системата Windows. Размерът на файла се определя от вашите системни настройки. Конкретният метод за настройка е следният: Отворете прозореца за настройка „Свойства“ на „Моят компютър“, превключете към раздела „Разширени“ и в колоната „Напишете информация за отстраняване на грешки“ в прозореца „Стартиране и възстановяване“, ако използвате "None"", задайте размера на файла на страницата на около 2 MB. Ако използвате "corememorystorage" и "fullmemorystorage", задайте стойността на файла на страницата на по-голяма стойност, която е почти същата като физическата памет.

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.

Напомняне:

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

Свързана

виртуална памет

виртуална памет

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.

Метод на замяна

Случаен алгоритъм

Използвайте софтуерен или хардуерен генератор на случайни числа, за да определите страницата за замяна.

Първи влязъл, първи излязъл

Първата страница, прехвърлена в основната памет, се заменя първа.

Най-малко използван алгоритъм

Заменете страниците, които не са били използвани най-дълго време.

VirtualandRealAddress

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

2.Процес за достъп до виртуална памет

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.

В системата за съхранение на три нива, двете нива на паметта на кеш-основната памет и основната памет-спомагателната памет имат много прилики:

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

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

Система за съхранение

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) Проблем със замяната: Решете кои програми и данни трябва да бъдат прехвърлени от основната памет.

(4) Проблем с актуализацията: Осигурете съгласуваността на основната памет и допълнителната памет.

Underthecontroloftheoperatingsystem,hardwareandsystemsoftwaresolvetheaboveproblemsforusers,thusgreatlysimplifyingapplicationprogramming.

График, базиран на страници

1.Виртуална памет, базирана на страници, нанасяне на адреси

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.Буфер за обратно преобразуване

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

3.Таблица на вътрешна страница и таблица на външна страница

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

Планиране на сегменти

Система за виртуално съхранение на сегменти

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.

Сегментната виртуална памет има много предимства:

①Логическата зависимост на сегмента прави сайта лесен за компилиране, управление, модифициране и защита и също така удобен за споделяне на множество програми.

②Thesegmentlengthcanbedynamicallychangedaccordingtoneeds,allowingfreescheduling,inordertoeffectivelyusethemainmemoryspace.

Сегментната виртуална памет също има някои недостатъци:

①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.

Форматът на виртуалния адрес е следният:

Основен номер

Номер на сегмент

Номер на страница

Адрес в страницата

Алгоритъм за преобразуване

Преобразуването на адреса на виртуалната памет основно има три вида процедури за работа с виртуална памет: пълно асоциативно преобразуване, директно преобразуване и групово пасоциативно преобразуване. начинът, по който страницата на всяко логическо пространство може да бъде преобразувана само в конкретна страница във физическото пространство, се нарича директно преобразуване. Груповата асоциативна трансформация се отнася до директна трансформация между групи и пълна асоциативна трансформация между страници в група. Използва се правило за замяна, за да се определи коя част от основната памет да се замени, така че да се освободи част от основната памет и да се съхрани част от съдържанието да се прехвърлят от спомагателната памет. Има 4 често срещани алгоритъма за заместване.

②Първи влезли първи излезли: Първата страница, прехвърлена в основната памет, се заменя първа.

③Най-малко използван горитъм: Заменете страниците, които не са били използвани най-дълго време.

④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