1,592 views
0 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 1 vote
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
Position:
Show:

Related questions

0 0 votes
1 1 answer
269
269 views
1 1 vote
0 0 answers
209
209 views
Ekalavyaa asked Jul 17, 2025
209 views
A) 4952B) 1488C) 5952D) 1382
2 2 votes
1 1 answer
1.2k
1.2k views
abhiagr2 asked Oct 19, 2024
1,232 views
fork(); fork(); printf("Gate2024"); fork();what will be the answer?