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.

如有侵权,请联系作者删除
目录
相关文章
|
算法 安全 调度
多线程如何工作,工作原理是什么
多线程如何工作,工作原理是什么
|
存储 云安全 运维
安全之心:一文读懂可信计算
信 or 不信,这是个问题
2908 0
安全之心:一文读懂可信计算
|
9月前
|
存储 人工智能 安全
赋能数字化转型的创新引擎
阿里云是全球领先的云计算与人工智能科技公司,其强大的技术实力和丰富的解决方案正深刻影响企业运营与竞争力。依托坚实的云计算基础设施,阿里云提供弹性计算、存储与网络服务,满足多样化需求。在AI与大数据领域,机器学习平台PAI及MaxCompute助力智能决策与创新应用。同时,阿里云构建全方位安全防护体系,保障数据隐私,并通过活跃的开发者社区与生态合作推动行业进步。未来,阿里云将持续加大研发投入,优化云原生技术,深化AI与大数据研究,引领数字化转型潮流,共创美好未来。
赋能数字化转型的创新引擎
|
人工智能 运维 自然语言处理
OS Copilot深度体验:大模型赋能下的操作系统智能助手
作为一名运维工程师,我体验了阿里云推出的OS Copilot,这款操作系统智能助手结合大语言模型与专业知识,提供自然语言问答、辅助命令执行和系统运维调优等功能。通过简单的命令行接口,用户可在主流Linux系统中快速启动这些功能,大幅提升效率,尤其适合复杂任务处理。安装简便,支持批量操作,大幅减少重复劳动。建议尝试,探索AI在系统管理中的潜力。
369 25
OS Copilot深度体验:大模型赋能下的操作系统智能助手
|
XML 存储 JSON
51. 【Android教程】JSON 数据解析
51. 【Android教程】JSON 数据解析
416 2
|
12月前
|
存储 编解码 人工智能
一文彻底揭开你不知道的二进制的秘密
本文介绍了二进制的基础概念及其在图片、声音和视频数字化中的应用。从位(bit)和字节(byte)到分辨率、采样率和压缩标准,带你深入了解计算机如何处理多媒体信息。君志所向,一往无前!
748 1
|
12月前
|
人工智能 Java 程序员
一文彻底搞定电阻元件
电阻元件是限流器件,通过其电流与两端电压成正比(V=IR),阻值受温度、材料等影响。按特性分为线性与非线性,材料上有碳膜、金属膜等,用途涵盖限流、分压、偏置、滤波等。标称阻值有允许偏差,额定功率和最高工作电压需注意。色标法和直接读取法可用于识别阻值,万用表测量时需关闭电源并选择合适量程。电阻在电路设计中不可或缺,掌握其特性和应用对电子工程师至关重要。
889 0
一文彻底搞定电阻元件
|
弹性计算 人工智能 自然语言处理
GPU实验室-通过GPU云服务器生成AI视频
自多态模型GPT-4发布后,AIGC(AI Generated Content,AI生成内容)时代正扑面而来,从单一的文字文本,演化到更丰富的图片、视频、音频、3D模型等。本文基于阿里云GPU服务器和文本生成视频模型,采用Unet3D结构,通过从纯高斯噪声视频中,迭代去噪的过程,实现文本生成视频功能。