Question: A one Megabytes block of memory is allocated using the buddy system. Show the results of the following sequence of requests and returns in a
A one Megabytes block of memory is allocated using the buddy system. Show the results of the following sequence of requests and returns in a figure that is similar to Figure 7.6: Request A: 200 Kilobytes; Request B: 80 Kilobytes; Request C: 380 Kilobytes; Return A; Request D: 120 Kilobytes; Return B; Return D; Return C. Also, find the internal fragmentation at each stage of allocation/de-allocation.

1 Mbyte block 1M Request 100K A= 128K 128K 256K 512K Request 240 K A= 128K 128K B= 256K 512K Request 64 K A= 128K C = 64K 64K B = 256K 512K Request 256 K A= 128K C = 64K 64K B= 256K D= 256K 256K Release B A= 128K C = 64K 64K 256K D= 256K 256K Release A 128K C-64K 64K 256K D = 256K 256K Request 75 K E = 128K C = 64K 64K 256K D= 256K 256K Release C E = 128K 128K 256K D= 256K 256K Release E 512K D= 256K 256K Release D IM Figure 7.6 Example of Buddy System
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
