edited by
7,129 views
2 votes
2 votes

Consider the requests from processes in given order $300K$, $25K$, $125K$ and $50K$. Let there be two blocks of memory available of size $150K$ followed by a block size $350K$.
Which of the following partition allocation schemes can satisfy above requests?

  1. Best fit but not first fit.
  2. First fit but not best fit.
  3. Both First fit & Best fit.
  4. neither first fit nor best fit.

Solution: Let us try all options.
Best Fit:
$300K$ is allocated from block of size $350K$. $50$ is left in the block.
$25K$ is allocated from the remaining $50K$ block. $25K$ is left in the block.
$125K$ is allocated from $150 K$ block. $25K$ is left in this block also.
$50K$ can’t be allocated even if there is $25K + 25K $ space available.

First Fit:
$300K$ request is allocated from $350K$ block, $50K$ is left out.
$25K$ is be allocated from $150K$ block, $125K$ is left out.
Then $125K$ and $50K$ are allocated to remaining left out partitions.
So, first fit can handle requests.

So option B is the correct choice.

DOUBT: Here we assumed a partition can be allocated to a process even if some other process occupies a part of that partition. But in many other questions, no process can be allocated to partition already allocated to some other process even if there is space available in the partition.

Eg. If we have a partition of $300KB$ already occupied by a process of $200KB$ then a process with size $100KB$ can't be allocated to this partition.

Which approach is correct?

edited by

1 Answer

1 votes
1 votes

in FIXED PARTITION SCHEMA memory will we divided into fixed number of partition . and in every partition only one process is allocated.

in VARIABLE PARTITION SCHEMA we can allocate more then one process in partition . if you have continuous memory .

in question it is given

Related questions

0 votes
0 votes
0 answers
1
Nidhi Budhraja asked Oct 1, 2018
616 views
Is it true that we can allocate only one process to one block?In First fit memory allocation scheme, can we allocate two processes to the same block of memory if block ha...
3 votes
3 votes
1 answer
2
kapilbk1996 asked Jul 28, 2018
2,607 views
Consider 900 KB memory is managed using variable partitions but no compaction. It currently has three process occupied partition of sizes 212 KB, 114 KB and 100 KB respec...
1 votes
1 votes
0 answers
3
Swami patil asked Nov 10, 2017
413 views
In an multiprogramming fixed partitioning the number of partitions are fixed or size of partitions are fixed please explain
1 votes
1 votes
1 answer
4