Question on Contiguous Memory Management | Operating System - M05 P06

Subscribe to my newsletter and never miss my upcoming articles

This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the fifth module which consists of 26 articles.

In this article we are going to see a question based on various allocation methods in contiguous memory management, so we can get a better understanding of the concept.

Question: Request from process are 300 KB, 25 KB, 125 KB, 50 KB respectively, the above request could be satisfied with

Untitled Diagram.png

  1. Best-fit but not first-fit
  2. First-fit but not best-fit
  3. Both
  4. None

Answer:

  • (ii) First-fit but not best-fit
  • If we allocate process according to the concept of first-fit than all the process will get place, like this

Untitled Diagram (1).png

  • But if we use best-fit concept to allocate the process into the RAM, then the structure of the RAM will look like this.

Untitled Diagram (2).png

  • Here we cannot put 50 KB process (P4) in RAM due to external fragmentation. This is because in contiguous memory allocation we cannot divide process into different fragments.

So this was a simple question on various allocation methods in contiguous memory management. Hope you liked it and learned something new from it.

If you have any doubt, question, quires related to this topic or just want to share something with me, than please feel free to contact me.

📱 Contact Me

Twitter, LinkedIn, Telegram, Instagram,

📧 Write a mail

rahulmishra102000@gmail.com

GitHub, HackerRank

No Comments Yet