How to assign free areas? | Operating system principle

简介: How to assign free areas? | Operating system principle

Under variable partition storage management, the main storage free areas arranged incrementally by address are: 10KB, 4KB, 20KB, 18KB, 7KB, 9KB, 12KB, and 15KB. For the following continuous storage requests: 12KB, 10KB, 15KB, 18KB, ask: using the first fit algorithm, the best adaptation algorithm, Which idle area will be used ?


Answer

(1) First fit algorithm:

    Free zone queue is: 10KB , 4KB , 20KB , 18KB , 7KB , 9KB , 12KB , 15KB

    First allocate:
      Allocate 12KB jobs: find free zone of first conform is 20KB, segmentation this free zone, this job use 12KB, Remaining free zone 8KB.
      Free zone end queue of assignment is:
10KB | 4KB | 8KB | 18KB | 7KB | 9KB | 12KB |15KB
| -- | -- | -- | -- | -- | -- | -- | -- | -- |

    Second allocate:
      Allocate 10KB jobs: find free zone of first conform is 10KB, is completely assigned.
      Free zone end queue of assignment is:
4KB | 8KB | 18KB | 7KB | 9KB | 12KB | 15KB
| -- | -- | -- | -- | -- | -- | -- |

    The third allocate:
      Allocate 15KB jobs: find free zone of first conform is 18KB, segmentation this free zone, this job use 15KB, Remaining free zone 3KB.
      Free zone end queue of assignment is:

    The fourth allocate:
      Allocate 18KB jobs: can't find free zone of Greater than 18KB, so this job allocate failed.


(2) Best fit algorithm:

    Free zone queue is:

    First allocate:
      Allocate 12KB jobs: find free zone of first conform is 12KB, is completely assigned.
      Free zone end queue of assignment is:

    Second allocate:
      Allocate 10KB jobs: find free zone of first conform is 10KB, is completely assigned.
      Free zone end queue of assignment is:
4KB | 7KB | 9KB | 15KB | 18KB | 20KB
| -- | -- | -- | -- | -- | -- | -- | -- |

    The third allocate:
      Allocate 15KB jobs: find free zone of first conform is 15KB, is completely assigned.
      Free zone end queue of assignment is:

    The fourth allocate:
      Allocate 18KB jobs: find free zone of first conform is 18KB, is completely assigned.
      Free zone end queue of assignment is:
4KB | 7KB | 9KB | 20KB
| -- | -- | -- | --

---

(3) Worse fit algorithm:

    Free zone queue is:

    First allocate:
      Allocate 12KB jobs: find free zone of first conform is 20KB, segmentation this free zone, this job use 12KB, Remaining free zone 8KB.
      Free zone end queue of assignment is:

    Second allocate:
      Allocate 10KB jobs: find free zone of first conform is 18KB, is completely assigned.
      Free zone end queue of assignment is:

    The third allocate:
      Allocate 15KB jobs: find free zone of first conform is 15KB, segmentation this free zone, this job use 15KB, Remaining free zone 3KB.
      Free zone end queue of assignment is:

    The fourth allocate:
      Allocate 18KB jobs: can't find free zone of Greater than 18KB, so this job allocate failed.

如有侵权,请联系作者删除
目录
相关文章
|
5月前
|
Oracle 关系型数据库
Customer RecommendedORA-27090 - Unable to Reserve Kernel Resources for Asynchronous Disk I/O
Customer RecommendedORA-27090 - Unable to Reserve Kernel Resources for Asynchronous Disk I/O
44 4
|
Oracle 关系型数据库 Unix
|
供应链
PAT (Advanced Level) Practice - 1079 Total Sales of Supply Chain(25 分)
PAT (Advanced Level) Practice - 1079 Total Sales of Supply Chain(25 分)
135 0
Why expand does not work for complex note
Why expand does not work for complex note? Created by Wang, Jerry, last modified on Jan 12, 2015
Why expand does not work for complex note
2015-03-17 current note creation logic in my task
2015-03-17 current note creation logic in my task
110 0
2015-03-17 current note creation logic in my task
Field creation not permitted in partner development mode
Field creation not permitted in partner development mode
Field creation not permitted in partner development mode
how to know which settype an assignment block is built based on
how to know which settype an assignment block is built based on
how to know which settype an assignment block is built based on
Communication error with the external tax system VERTEX
Communication error with the external tax system VERTEX
120 0
Communication error with the external tax system VERTEX
|
Java 虚拟化 C++
Stack based vs Register based Virtual Machine Architecture
进程虚拟机简介 一个虚拟机是对原生操作系统的一个高层次的抽象,目的是为了模拟物理机器,本文所谈论的是基于进程的虚拟机,而不是基于系统的虚拟机,基于系统的虚拟机可以用来在同一个平台下去运行多个不同的硬件架构的操作系统,常见的有kvm,xen,vmware等,而基于进程的虚拟机常见的有JVM,PVM(python虚拟机)等,java和python的解释器将java和python的代码编译成JVM和P
3660 0