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.

如有侵权,请联系作者删除
目录
相关文章
|
C# C++ Windows
PDMS call Operating System Command
PDMS call Operating System Command eryar@163.com 1.Introduction AVEVA提供了三种二次开发的方式:DARs, PML和AVEVA .Net(C#)。
2186 0
|
7月前
|
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
52 4
|
存储 缓存 固态存储
Managing Non-Volatile Memory in Database Systems
Managing Non-Volatile Memory in Database Systems
111 0
|
Oracle 关系型数据库 Unix
|
Java 虚拟化 C++
Stack based vs Register based Virtual Machine Architecture
进程虚拟机简介 一个虚拟机是对原生操作系统的一个高层次的抽象,目的是为了模拟物理机器,本文所谈论的是基于进程的虚拟机,而不是基于系统的虚拟机,基于系统的虚拟机可以用来在同一个平台下去运行多个不同的硬件架构的操作系统,常见的有kvm,xen,vmware等,而基于进程的虚拟机常见的有JVM,PVM(python虚拟机)等,java和python的解释器将java和python的代码编译成JVM和P
3687 0