1,113 views
2 votes
2 votes

Q : In variable allocation without compaction strategy of memory allocation , can we allocate the memory space to a process arbitrarily anywhere within the free space..I have a doubt on this since the allocation should comply with the standard methods like best fit , worst fit or  can we allocate arbitrarily ?.

Actually I m facing this doubt on the question having link :

https://gateoverflow.in/2747/gate1996_2-18

Plz explain someone..

2 Answers

Best answer
4 votes
4 votes

Short Answer:

First Part:

In variable partition method, in order to have better utilization of main memory, OS must use one of the placement algorithms such as best fit, first fit, next etc.

So if the OS designer chooses to assign memory to processes arbitrarily, it would lead to inefficient use of memory.

Second Part:

Correct answer will be 181 KB. I have added my answer to the Gate question. Please have a look at it.


Explanations:

First Part:

In one of the examples given in the book by stallings, in variable partitioning (referred as dynamic partitioning in the book) :

In this example,  processes start by getting allocated one after other (which is not necessary as we'll see later), but later after few swappings have taken place, holes are created. Now OS would have used compaction to line up the free space which is a time consuming problem.

So OS would try to reduce the need of compaction by managing the allocation of holes to processes efficiently and for that uses placement algorithms such as : best fit, first fit, next fit etc. (in our case we are ignoring compaction, which we can think as reducing the need of compaction to maximum extent)

This whole thing, i.e., managing the allocation of holes to processes efficiently can be done from the beginning itself, considering whole memory as one big hole, and use placement algorithms such that the need of compaction is minimized (we can totally ignore compaction in our case)

edited by
0 votes
0 votes

the doubt is genuine . but if we will consider that question(on link) it is asking about the  smallest allocation request in Kbytes that could be denied is for ?? where we will totally focus on our intuition and that will always considered under arbitary allocation. 

Related questions