Question

Apply the first-fit, best-fit, and worst-fit algorithms separately the given processes in sequence from P1 to P4 and Identify which algorithm makes the most efficient use of memory? Show every step for process assignment, also discuss the internal and external fragmentation in the scenario.

220 KB P1 250 KB P2 390 KB 460 KB P4 P3 150 KB 100 KB 517 KB 340 KB Processes 730 KB Memory Partition

0 0
Add a comment Improve this question Transcribed image text
Answer #1

P1 - 250 KB, P2 - 390 KB, P3 - 150 KB, P4 - 517 KB

First fit algorithm : The first job claims the first memory which is large enough for the process

Memory block size Job number Job size Status Internal fragmentation
220 KB P3 150 KB Busy 70 KB
460 KB P1 250 KB Busy 210 KB
100 KB Free 100 KB
340 KB Free 340 KB
730 KB P2 390 KB Busy 340 KB

Total available : 1850 KB

Total used :

790 KB

Total I. F : 1060 KB

Best fit : It allocates the smallest memory which is large enough to hold the process

Memory block size Job number Job size Status Internal fragmentation
220 KB P3 150 KB Busy 70 KB
460 KB P2 390 KB Busy 70 KB
100 KB Free 100 KB
340 KB P1 250 KB Busy 90 KB
730 KB P4 517 KB Busy 213 KB

Total available : 1850 KB

Total used :

1307 KB

Total I. F :

543 KB

Worst fit : The algorithm allocates the largest memory which is enough to hold the process.

Memory block size Job number Job size Status Internal fragmentation
220 KB Free 220 Kb
460 KB P2 390 KB Busy 70 KB
100 KB Free 100 KB
340 KB P3 150 KB Busy 190 KB
730 KB P1 250 KB Busy 480 KB

Total available :

1850 KB

Total used :

790 KB

Total I. F : 1060 KB

Best fit algorithm makes the most efficient use of memory. In these algorithms, internal fragmentation happens.

Add a comment
Know the answer?
Add Answer to:
Apply the first-fit, best-fit, and worst-fit algorithms separately the given processes in sequence from P1 to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Memory Allocation a) Is it possible to have both internal and external fragmentation with fixed p...

    Memory Allocation a) Is it possible to have both internal and external fragmentation with fixed partition memory allocation? How about with dynamic/variable memory partition allocation? Explain. (1 point) b) Suppose we have 1000K of memory where the first 100K is reserved. Also suppose that the following processes have been allocated memory in the following order:                 P1: 100K, P2: 100K, P3: 25K, P4: 200K, P5: 200K, P6: 75K, P7: 100K. Create a diagram of memory. Suppose that P2, P4, and P6...

  • Memory Allocation a) Is it possible to have both internal and external fragmentation with fixed partition...

    Memory Allocation a) Is it possible to have both internal and external fragmentation with fixed partition memory allocation? How about with dynamic/variable memory partition allocation? Explain. (1 point) b) Suppose we have 1000K of memory where the first 100K is reserved. Also suppose that the following processes have been allocated memory in the following order:                 P1: 100K, P2: 100K, P3: 25K, P4: 200K, P5: 200K, P6: 75K, P7: 100K. Create a diagram of memory. Suppose that P2, P4, and...

  • Given six memory partitions of 800 KB,500 KB,350KB,200KB,450KB and 100 KB (in order), how would the...

    Given six memory partitions of 800 KB,500 KB,350KB,200KB,450KB and 100 KB (in order), how would the first-fit, best-fit and worst-fit algorithms place processes of size 315KB,600KB, 345KB, 110KB and 400KB(in order) i) Which algorithm makes the most efficient use of memory? ii) Are there any internal and external fragmentation? If yes, how it can be solved?

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT