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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

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

發布時間:2025/3/11 windows 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 操作系统 非连续分配_操作系统中的连续和非连续内存分配 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

操作系統 非連續分配

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.

在本文中,我們將學習不同類型的內存管理技術 ,以及不同內存管理技術的優缺點。

Memory management

內存管理

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.

內存對于計算機系統的運行至關重要。 它由大量的單詞或字節組成,每個單詞或字節都有自己的地址。 在單編程系統中,主存儲器分為兩部分,一部分用于操作系統,另一部分用于當前正在執行的程序。 在多程序系統中,用戶的存儲部分被進一步分為容納過程。 細分的任務無法由操作系統執行,因此稱為內存管理。

Memory management techniques

內存管理技術

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

內存管理技術分為兩部分...

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

    在單編程技術中,RAM分為兩部分,一部分用于重新命名操作系統,另一部分用于用戶進程。 這里使用了籬笆寄存器,其中包含操作系統部件的最后地址。 操作系統會將用戶數據地址與籬笆寄存器進行比較,如果不同,則意味著用戶沒有進入OS區域。 柵欄寄存器也稱為邊界寄存器,用于防止用戶進入操作系統區域。 在這里,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.

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

  • Contiguous memory allocation
  • Non-contiguous memory allocation
  • a)連續內存分配 (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.

    在連續內存分配中 ,所有可用內存空間都在一起放在一個位置。 這意味著免費可用的內存分區不會分散在整個內存空間中。

    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.

    在連續內存分配中 ,操作系統和用戶都必須駐留在主內存中。 主存儲器分為兩部分,一部分用于操作,另一部分用于用戶程序。

    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.

    在連續存儲器分配中,當任何用戶處理請求該存儲器時,根據其需要將連續存儲塊的單個部分提供給該處理。 通過將內存劃分為固定大小的分區,我們可以實現連續的內存分配。

    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.

    在該固定大小的單個分區中分配一個進程。 但是,這將增加多程序化的程度,這意味著主內存中有多個進程限制了內存中固定分區的數量。 內部碎片的增加是由于連續的內存分配。

    → Fixed sized partition

    →固定大小的分區

    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.

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

    Advantage: Management or book keeping is easy.

    優點:管理或簿記都很容易。

    Disadvantage: Internal fragmentation

    缺點:內部碎片化

    → Variable size partition

    →可變大小的分區

    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.

    在可變大小分區中,內存被視為一個單元,分配給進程的空間與所需的空間完全相同,剩余的空間可再次使用。

    Advantage: There is no internal fragmentation.

    優點:沒有內部碎片。

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

    缺點:管理非常困難,因為一段時間后內存將變得完全碎片化。

    b)非連續內存分配 (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.

    在非連續的內存分配中 ,可用的空閑內存空間分散在各處,并且所有空閑內存空間都不在一個地方。 因此,這很耗時。 在非連續的內存分配中 ,一個進程將獲取內存空間,但是根據該進程的要求,它并不位于一個位置,而是位于不同的位置。 這種非連續的內存分配技術可減少內存浪費,從而導致內部和外部碎片。 這將利用由不同進程創建的所有可用內存空間。

    Non-contiguous memory allocation is of different types,

    非連續內存分配類型不同,

  • Paging

    分頁

  • Segmentation

    分割

  • Segmentation with paging

    分頁細分

  • i) Paging

    i)分頁

    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.

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

    Advantages: It is independent of external fragmentation.

    優點:它獨立于外部碎片。

    Disadvantages:

    缺點:

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

    由于兩次訪問主內存,因此轉換速度非常慢。

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

    頁表是占用相當大空間的系統的負擔。

  • ii) Segmentation

    ii)細分

    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.

    分段是存儲器的程序員視圖,在這里,不是將進程劃分為相等大小的分區,而是根據程序將其劃分為稱為段的分區。 轉換與分頁相同,但分頁分段與內部分段無關,但會遭受外部分段。 外部碎片的原因是程序可以分為多個段,但是段本質上必須是連續的。

    iii) Segmentation with paging

    iii)使用分頁進行細分

    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.

    在使用分頁進行分段時,我們同時利用了分段和分頁的優勢。 這是一種多級分頁,但是在多級分頁中,我們將頁表劃分為相等大小的分區,但是在這里,在使用分頁進行分段時,我們將其按段進行劃分。 所有的屬性都與分頁的屬性相同,因為段被分為頁面。

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

    操作系統 非連續分配

    總結

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

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。