How can we measure Fragmentation/ discontinuity ?

2 replies · 2K views · last reply
Aadharsh Aadhithya
Messages
5
Reaction score
0
How can we measure Fragmentation/ discontinuity in a system?
 
It depends exactly what you mean by "fragmentation in system" - but one simple formula you could use would be:

(free - freemax)
---------------- x 100% (or 100% for free=0)
free
where

free = total number of bytes free
freemax = size of largest free block
That way, if all memory is in one big block, the fragmentation is 0%, and if memory is all carved up into hundreds of tiny blocks, it will be close to 100%.