-1
$\begingroup$

I want to find the total external and internal fragmentation. What I understand is that external fragmentation occurs when processes are loaded and removed from memory, causing memory to be broken into little pieces, and that internal fragmentation is the unused memory internal to a partition.

As an example, say I had the following memory holes: 50 KB, 400 KB, 130 KB, 300 KB, 150 KB, and 70 KB (in that order). Now I have the following processes that need the following memory space (in order): A = 230 KB, B =180 KB, C = 130 KB, D = 120 KB, E = 200 KB.

Using the first fit method, I have determined the following allocation:

50 KB hole is assigned 0 processes -> 50 KB free
400 KB hole is assigned processes A and C -> 40 KB free
130 KB hole is assigned process D -> 10 KB free
300 KB hole is assigned process B -> 120 KB free
150 KB hole is assigned 0 processes -> 150 KB free
70 KB hole is assigned 0 processes -> 70 KB free

So, based on my understanding of the definitions:

Total internal fragmentation = 50 KB + 150 KB + 70 KB = 270 KB
Total external fragmentation = 40 KB + 10 KB + 120 KB = 170 KB

Is this correct? Thanks.

$\endgroup$
  • 1
    $\begingroup$ We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. $\endgroup$ – David Richerby Nov 13 '16 at 23:45
  • $\begingroup$ Yes, the conceptual issue is finding the total external and internal fragmentation. It's the title of the question. I provided an example as an attempt to answer my own question. $\endgroup$ – jshapy8 Nov 13 '16 at 23:47
  • $\begingroup$ What does "the fragmentation" actually measure? I don't even know what units are appropriate to describe a quantity with this name -- but it seems very unlikely that it would simply be a number of bytes formed by summing the size of each fragment, simply because then "the fragmentation" of a single hole of size 270KB would be the same as "the fragmentation" of 270 holes, each of size 1KB, when clearly any meaningul measure would assign a bigger number to the latter. $\endgroup$ – j_random_hacker Nov 14 '16 at 11:07
0
$\begingroup$

According to the problem ,process A is allocated to 400 KB memory ,so the memory is split into two part , one to satisfy the request and remaining (170 KB) is type of external fragmentation denoted by (170 KB E) .

Similarly for process B using 300 KB that results 120 KB E.

Similarly for process c using (170 KB E) results (40 KB E).

Similarly for process D using (130 KB) results (10 KB E) request of process E can't be completed So total external fragmentation = 40 +10+120=170 KB

Total internal fragmentation = 50 + 150 + 70=270 KB

$\endgroup$
0
$\begingroup$

NO! The Total Internal Fragmentation is 40 + 10 + 120 = 170kB And Total External Fragmentation is 50 +150 + 70 = 270kB

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.