956 views
0 votes
0 votes

19 If a system has 16 kB memory and buddy system is used to allocate the memory for process during
runtime. Consider the following sequence:
• Process P1 of size 7 kB loaded
• Process P2 of size 4 kB loaded
Process P1 is terminated and space is return (available for other processes).
Process P3 of size 6 kB loaded
Process P4 of size 3 kB loaded
How much space is wasted due to internal fragmentation _______ (in kB).

1 Answer

1 votes
1 votes
I have not read Buddy Sytem till the date but thanks buddy I googled it and found an easiest video to understand basics of 'Buddy System':
https://m.youtube.com/watch?v=ZI3ybYeHOdI

Now, come to the sum:
16kB

Process P1(7 kB): 16 divides in two parts: 8 kB(Part-A) and 8 kB(Part-B)  and P1 fits in one of the blocks.

Process P2(4 kB): Second part (Part-B)  of 8k divides in two parts(Part-B.1 and Part-B.2): 4 kB and 4 kB and P2 fits in one of the blocks.

P1 releases so 8 kB is free again.

Process P3(6 kB): Goes directly into 8 kB part which is recently got free from P1(Part-A)

Process P4(3 kB): We have Part-B.2 still free with us which is a size of 4 kB.
 
so after executing each steps we have 1 kB internal fragmentation in Part-B.2 and 2 kB internal fragmentation in Part-A(where process-P3 is running)

So coming to the total internal fragmentation I'm bit confused about Process-P1 as it is released already then should we have to count its 1 kB internal fragmentation or not?(plz tell me)

Total= 1 + 2 + (1 in doubt) = 3 or 4 kB

Related questions

0 votes
0 votes
0 answers
2
Gate Fever asked Jan 21, 2019
467 views
consider a disk having 10 platters with 2 recording surfaces each surface contains 80 tracks and each track contains 400 sectors with 1 sector capacity of 4KB.The capacit...