Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.) (25) On a system using a first-fit allocation, assume memory is allocated as

ID: 3720566 • Letter: 1

Question

1.) (25) On a system using a first-fit allocation, assume memory is allocated as illustrated in the image below. What happens after memory requests for P1 for 20k, P2 for 10k, and P3 for 5k are received in that specific order? Be sure to specify where the memory requests will be allocated. Used | Hole | Used | Hole |Used| sed Hole Used Hole UsedHole 2.) (25) On a system using a best-fit allocation, assume memory is allocated as illustrated in the image below. What happens after memory requests for P1 for 20k, P2 for 10k, and P3 for 5k are received in that specific order? Be sure to specify where the memory requests will be allocated. Used | Hole! Used | Hole |Used| | Used | Hole |Used! Hole | Used | Hole Udole

Explanation / Answer

1. In the first fit allocation strategy, the OS scans the memory and the first unused hole having size grater than or equal to the required memory is allocated.

Thus the first 4th 30K hole is allocated to P1(requires 20K).. P1 would occupy 20K and rest 10K will be a hole

The 2nd 10K hole is allocated to P2(requires 10K)

The 10K hole left by P1 will be used by P3(requires 5K) and it would leave a 5K hole

The 10k hole is left Thus,the memory looks as follows:

Used(10K) P2(10K) Used(20K) P1(20K) P3(5K) Hole(5K) Used(10K) Hole(5K) Used(30K) Hole(20K) Used(10K) Hole(15K) Used(20K) Hole(20K)