日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > windows >内容正文

windows

操作系统 非连续分配_操作系统中的连续和非连续内存分配

發(fā)布時(shí)間:2025/3/11 windows 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 操作系统 非连续分配_操作系统中的连续和非连续内存分配 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

操作系統(tǒng) 非連續(xù)分配

In this article, we will learn about the different types of memory management techniques and also the pros and cons of different memory management techniques.

在本文中,我們將學(xué)習(xí)不同類型的內(nèi)存管理技術(shù) ,以及不同內(nèi)存管理技術(shù)的優(yōu)缺點(diǎn)。

Memory management

內(nèi)存管理

Memory is central to the operation of a computer system. It consists of a large array of words or bytes each with its own address. In uniprogramming system, main memory has two parts one for the operating system and another part is for the program currently being executed. In the multiprogramming system, the memory part of the user is further divided into accommodate processes. The task of the subdivision is cannot out by the operating system and is known as memory management.

內(nèi)存對(duì)于計(jì)算機(jī)系統(tǒng)的運(yùn)行至關(guān)重要。 它由大量的單詞或字節(jié)組成,每個(gè)單詞或字節(jié)都有自己的地址。 在單編程系統(tǒng)中,主存儲(chǔ)器分為兩部分,一部分用于操作系統(tǒng),另一部分用于當(dāng)前正在執(zhí)行的程序。 在多程序系統(tǒng)中,用戶的存儲(chǔ)部分被進(jìn)一步分為容納過(guò)程。 細(xì)分的任務(wù)無(wú)法由操作系統(tǒng)執(zhí)行,因此稱為內(nèi)存管理。

Memory management techniques

內(nèi)存管理技術(shù)

The memory management techniques is divided into two parts...

內(nèi)存管理技術(shù)分為兩部分...

  • Uniprogramming:

    單編程:

    In the uniprogramming technique, the RAM is divided into two parts one part is for the resigning the operating system and other portion is for the user process. Here the fence register is used which contain the last address of the operating system parts. The operating system will compare the user data addresses with the fence register and if it is different that means the user is not entering in the OS area. Fence register is also called boundary register and is used to prevent a user from entering in the operating system area. Here the CPU utilization is very poor and hence multiprogramming is used.

    在單編程技術(shù)中,RAM分為兩部分,一部分用于重新命名操作系統(tǒng),另一部分用于用戶進(jìn)程。 這里使用了籬笆寄存器,其中包含操作系統(tǒng)部件的最后地址。 操作系統(tǒng)會(huì)將用戶數(shù)據(jù)地址與籬笆寄存器進(jìn)行比較,如果不同,則意味著用戶沒(méi)有進(jìn)入OS區(qū)域。 柵欄寄存器也稱為邊界寄存器,用于防止用戶進(jìn)入操作系統(tǒng)區(qū)域。 在這里,CPU利用率非常差,因此使用了多程序。

  • Multiprogramming:

    多重編程:

    In the multiprogramming, the multiple users can share the memory simultaneously. By multiprogramming we mean there will be more than one process in the main memory and if the running process wants to wait for an event like I/O then instead of sitting ideal CPU will make a context switch and will pick another process.

    在多重編程中,多個(gè)用戶可以同時(shí)共享存儲(chǔ)器。 通過(guò)多程序,我們意味著主內(nèi)存中將有多個(gè)進(jìn)程,并且如果正在運(yùn)行的進(jìn)程要等待I / O之類的事件,則與其坐擁理想的CPU,而是進(jìn)行上下文切換,然后選擇另一個(gè)進(jìn)程。

  • Contiguous memory allocation
  • Non-contiguous memory allocation
  • a)連續(xù)內(nèi)存分配 (a) Contiguous memory allocation)

    In contiguous memory allocation, all the available memory space remain together in one place. It means freely available memory partitions are not scattered here and there across the whole memory space.

    在連續(xù)內(nèi)存分配中 ,所有可用內(nèi)存空間都在一起放在一個(gè)位置。 這意味著免費(fèi)可用的內(nèi)存分區(qū)不會(huì)分散在整個(gè)內(nèi)存空間中。

    In the contiguous memory allocation, both the operating system and the user must reside in the main memory. The main memory is divided into two portions one portion is for the operating and other is for the user program.

    在連續(xù)內(nèi)存分配中 ,操作系統(tǒng)和用戶都必須駐留在主內(nèi)存中。 主存儲(chǔ)器分為兩部分,一部分用于操作,另一部分用于用戶程序。

    In the contiguous memory allocation when any user process request for the memory a single section of the contiguous memory block is given to that process according to its need. We can achieve contiguous memory allocation by dividing memory into the fixed-sized partition.

    在連續(xù)存儲(chǔ)器分配中,當(dāng)任何用戶處理請(qǐng)求該存儲(chǔ)器時(shí),根據(jù)其需要將連續(xù)存儲(chǔ)塊的單個(gè)部分提供給該處理。 通過(guò)將內(nèi)存劃分為固定大小的分區(qū),我們可以實(shí)現(xiàn)連續(xù)的內(nèi)存分配。

    A single process is allocated in that fixed sized single partition. But this will increase the degree of multiprogramming means more than one process in the main memory that bounds the number of fixed partition done in memory. Internal fragmentation increases because of the contiguous memory allocation.

    在該固定大小的單個(gè)分區(qū)中分配一個(gè)進(jìn)程。 但是,這將增加多程序化的程度,這意味著主內(nèi)存中有多個(gè)進(jìn)程限制了內(nèi)存中固定分區(qū)的數(shù)量。 內(nèi)部碎片的增加是由于連續(xù)的內(nèi)存分配。

    → Fixed sized partition

    →固定大小的分區(qū)

    In the fixed sized partition the system divides memory into fixed size partition (may or may not be of the same size) here entire partition is allowed to a process and if there is some wastage inside the partition is allocated to a process and if there is some wastage inside the partition then it is called internal fragmentation.

    在固定大小的分區(qū)中,系統(tǒng)將內(nèi)存劃分為固定大小的分區(qū)(大小可能相同,也可能不同),此處允許將整個(gè)分區(qū)分配給一個(gè)進(jìn)程,如果該分區(qū)內(nèi)部有一些浪費(fèi),則將其分配給進(jìn)程分區(qū)中的一些浪費(fèi),然后稱為內(nèi)部碎片。

    Advantage: Management or book keeping is easy.

    優(yōu)點(diǎn):管理或簿記都很容易。

    Disadvantage: Internal fragmentation

    缺點(diǎn):內(nèi)部碎片化

    → Variable size partition

    →可變大小的分區(qū)

    In the variable size partition, the memory is treated as one unit and space allocated to a process is exactly the same as required and the leftover space can be reused again.

    在可變大小分區(qū)中,內(nèi)存被視為一個(gè)單元,分配給進(jìn)程的空間與所需的空間完全相同,剩余的空間可再次使用。

    Advantage: There is no internal fragmentation.

    優(yōu)點(diǎn):沒(méi)有內(nèi)部碎片。

    Disadvantage: Management is very difficult as memory is becoming purely fragmented after some time.

    缺點(diǎn):管理非常困難,因?yàn)橐欢螘r(shí)間后內(nèi)存將變得完全碎片化。

    b)非連續(xù)內(nèi)存分配 (b) Non-contiguous memory allocation)

    In the non-contiguous memory allocation the available free memory space are scattered here and there and all the free memory space is not at one place. So this is time-consuming. In the non-contiguous memory allocation, a process will acquire the memory space but it is not at one place it is at the different locations according to the process requirement. This technique of non-contiguous memory allocation reduces the wastage of memory which leads to internal and external fragmentation. This utilizes all the free memory space which is created by a different process.

    在非連續(xù)的內(nèi)存分配中 ,可用的空閑內(nèi)存空間分散在各處,并且所有空閑內(nèi)存空間都不在一個(gè)地方。 因此,這很耗時(shí)。 在非連續(xù)的內(nèi)存分配中 ,一個(gè)進(jìn)程將獲取內(nèi)存空間,但是根據(jù)該進(jìn)程的要求,它并不位于一個(gè)位置,而是位于不同的位置。 這種非連續(xù)的內(nèi)存分配技術(shù)可減少內(nèi)存浪費(fèi),從而導(dǎo)致內(nèi)部和外部碎片。 這將利用由不同進(jìn)程創(chuàng)建的所有可用內(nèi)存空間。

    Non-contiguous memory allocation is of different types,

    非連續(xù)內(nèi)存分配類型不同,

  • Paging

    分頁(yè)

  • Segmentation

    分割

  • Segmentation with paging

    分頁(yè)細(xì)分

  • i) Paging

    i)分頁(yè)

    A non-contiguous policy with a fixed size partition is called paging. A computer can address more memory than the amount of physically installed on the system. This extra memory is actually called virtual memory. Paging technique is very important in implementing virtual memory. Secondary memory is divided into equal size partition (fixed) called pages. Every process will have a separate page table. The entries in the page table are the number of pages a process. At each entry either we have an invalid pointer which means the page is not in main memory or we will get the corresponding frame number. When the frame number is combined with instruction of set D than we will get the corresponding physical address. Size of a page table is generally very large so cannot be accommodated inside the PCB, therefore, PCB contains a register value PTBR( page table base register) which leads to the page table.

    具有固定大小分區(qū)的非連續(xù)策略稱為分頁(yè)。 一臺(tái)計(jì)算機(jī)可以分配的內(nèi)存量大于系統(tǒng)上實(shí)際安裝的內(nèi)存量。 該額外的內(nèi)存實(shí)際上稱為虛擬內(nèi)存。 分頁(yè)技術(shù)對(duì)于實(shí)現(xiàn)虛擬內(nèi)存非常重要。 輔助內(nèi)存分為稱為頁(yè)面的相等大小的分區(qū)(固定)。 每個(gè)進(jìn)程將有一個(gè)單獨(dú)的頁(yè)表。 頁(yè)表中的條目是一個(gè)進(jìn)程的頁(yè)數(shù)。 在每個(gè)條目中,要么我們有一個(gè)無(wú)效的指針,這意味著該頁(yè)面不在主內(nèi)存中,要么我們將獲得相應(yīng)的幀號(hào)。 當(dāng)幀號(hào)與集合D的指令組合時(shí),我們將獲得相應(yīng)的物理地址。 頁(yè)表的大小通常很大,因此無(wú)法容納在PCB內(nèi)部,因此PCB包含一個(gè)指向頁(yè)表的寄存器值PTBR(頁(yè)表基址寄存器)。

    Advantages: It is independent of external fragmentation.

    優(yōu)點(diǎn):它獨(dú)立于外部碎片。

    Disadvantages:

    缺點(diǎn):

  • It makes the translation very slow as main memory access two times.

    由于兩次訪問(wèn)主內(nèi)存,因此轉(zhuǎn)換速度非常慢。

  • A page table is a burden over the system which occupies considerable space.

    頁(yè)表是占用相當(dāng)大空間的系統(tǒng)的負(fù)擔(dān)。

  • ii) Segmentation

    ii)細(xì)分

    Segmentation is a programmer view of the memory where instead of dividing a process into equal size partition we divided according to program into partition called segments. The translation is the same as paging but paging segmentation is independent of internal fragmentation but suffers from external fragmentation. Reason of external fragmentation is program can be divided into segments but segment must be contiguous in nature.

    分段是存儲(chǔ)器的程序員視圖,在這里,不是將進(jìn)程劃分為相等大小的分區(qū),而是根據(jù)程序?qū)⑵鋭澐譃榉Q為段的分區(qū)。 轉(zhuǎn)換與分頁(yè)相同,但分頁(yè)分段與內(nèi)部分段無(wú)關(guān),但會(huì)遭受外部分段。 外部碎片的原因是程序可以分為多個(gè)段,但是段本質(zhì)上必須是連續(xù)的。

    iii) Segmentation with paging

    iii)使用分頁(yè)進(jìn)行細(xì)分

    In segmentation with paging, we take advantages of both segmentation as well as paging. It is a kind of multilevel paging but in multilevel paging, we divide a page table into equal size partition but here in segmentation with paging, we divide it according to segments. All the properties are the same as that of paging because segments are divided into pages.

    在使用分頁(yè)進(jìn)行分段時(shí),我們同時(shí)利用了分段和分頁(yè)的優(yōu)勢(shì)。 這是一種多級(jí)分頁(yè),但是在多級(jí)分頁(yè)中,我們將頁(yè)表劃分為相等大小的分區(qū),但是在這里,在使用分頁(yè)進(jìn)行分段時(shí),我們將其按段進(jìn)行劃分。 所有的屬性都與分頁(yè)的屬性相同,因?yàn)槎伪环譃轫?yè)面。

    翻譯自: https://www.includehelp.com/operating-systems/contiguous-and-non-contiguous-memory-allocation.aspx

    操作系統(tǒng) 非連續(xù)分配

    總結(jié)

    以上是生活随笔為你收集整理的操作系统 非连续分配_操作系统中的连续和非连续内存分配的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

    如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。