1.9k views

Consider the following heap (figure) in which blank regions are not in use and hatched region are in use.

The sequence of requests for blocks of sizes $300, 25, 125, 50$ can be satisfied if we use

1. either first fit or best fit policy (any one)

2. first fit but not best fit policy

3. best fit but not first fit policy

4. None of the above

edited | 1.9k views
0
This question is incorrectly categorized. It should be in memory allocation not page replacement.
0
In this question if they give that use compaction then it can be allocated by any fit scheme

+2
they should mention whether static our dynamic allocation is used

In first fit, block request will be satisfied from the first free block that fits it.

So, request for $300$ will be satisfied by $350$ size block reducing the free size to $50$.
Request for $25$, satisfied by $125$ size block, reducing it to $125.$
Request for $125$ satisfied by $125$ size block.
And request for $50$ satisfied by the $50$ size block.
So, all requests can be satisfied.

In best fit strategy, a block request is satisfied by the smallest block in that can fit it.
So, request for $300$ will be satisfied by $350$ size block reducing the free size to $50$.
Request for $25$, satisfied by $50$ size block as its the smallest size that fits $25$, reducing it to $25$.
Request for $125$, satisfied by $150$ size block, reducing it to $25$.
Now, request for $50$ cannot be satisfied as the two $25$ size blocks are not contiguous.

edited by
+3
partition is static or dynamic is not mentioned.
0
In best-fit strategy, a block request is satisfied by the smallest block in that can fit it

In best-fit strategy, a block request is satisfied by the block having minimum internal fragmentation

are both of these statements equivalent?
0

http://www.techtud.com/preparation/introduction-0 this link more clarify this question

0
@arjun sir

why we are allocating more jobs in single block?is it fixed partition
0
In this case, we have variable partitioning, that's why. When a job comes and can be fitted in one of the free spaces available then that job is placed there which leaves out free space if any ( when the job requires less space than the corresponding free portion of memory where it is placed). Here there is no partition of memory. when the job finishes that portion of memory again becomes free. If there is adjacent free space then they coalesce with each other to make a larger free space.
0
it is given in question that it is heap which allocate blocks dynamically, so more than one processes can be in one block of partition.

please correct me if m wrong
0

@Tuhin Dutta

how to assume variable or fixed partition?

it should be b) because.. by using best fit external fragmentation will be there..
Only first fit
–1
Explanation ???
+1

Puja Mishra  first of all u have to go through the explanation given by arjun sir...he explained very nicely...And now i tried to make it more clear....

First Fit:

300--------> Chunk_350 bcz all the chunk before it are less than 300

now memory size becomes as

O_50 : F_150 : O_600 : F_50 : O_600, where O denotes occupied and F denotes free.

similarly,

25---------> F_150

memory size becomes as

O_50 : O_25 : F_125 : O_600 : F_50 : O_600

125-------> F_125

memory size becomes as

O_50 : O_25 : O_125 : O_600 : F_50 : O_600

50------> F_50

Best Fit:

300--------> Chunk_350 ( acc. to best fit, a block request is satisfied by the smallest block in that can fit it.)

now memory size becomes as

O_50 : F_150 : O_600 : F_50 : O_600,

similarly,

25---------> F_50

memory size becomes as

O_50 : F_150  : O_600 : O_25 : F_25 : O_600

125-------> F_150

memory size becomes as

O_50 : O_125 : F_25 : O_600 : O_25 : F_25 : O_600

50------> no space is available....so can't use it...

0
Ok ...u should hav ur own views when u r answering any question ... may be u hav ur own approach to solve a question .. otherwise it is unnecessary to answer questions without explaining .... I think u got my point  ..
+3
i already knew it very clearly....and these are my old answers....that time i answered the question without explaining it... now u got it.. ?

1
2