Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internal and external fragmentation [closed]

Can anyone please tell me the difference between internal and external fragmentation while allocation of disk space for files?

like image 653
wantobegeek Avatar asked Jul 29 '09 14:07

wantobegeek


People also ask

What is difference between internal fragmentation and external fragmentation?

Internal Fragmentation occurs when a process needs more space than the size of allotted memory block or use less space. External Fragmentation occurs when a process is removed from the main memory.

What is internal and external fragmentation with example?

Internal fragmentation occurs when memory is divided into fixed-sized partitions. External fragmentation occurs when memory is divided into variable size partitions based on the size of processes. 5. The difference between memory allocated and required space or memory is called Internal fragmentation.

Can you have both internal and external fragmentation with fixed partition memory allocation?

Internal fragmentation is sujected to "Fixed size partitioning scheme" and external fragmentation to "variable size partitioning ". No, there can never be external fragementation in fixed size partitioning because the leftover space cannot be used to allocate to any other process.

Can internal fragmentation be eliminated?

The internal fragmentation process cannot be eliminated, but can definitely be reduced by using best-fit block to the memory.


2 Answers

External fragmentation
Total memory space is enough to satisfy a request or to reside a process in it, but it is not contiguous so it can not be used.

External fragmentation

Internal fragmentation
Memory block assigned to process is bigger. Some portion of memory is left unused as it can not be used by another process.

Internal fragmentation

like image 186
Ankit Bhatia Avatar answered Oct 05 '22 18:10

Ankit Bhatia


First of all the term fragmentation cues there's an entity divided into parts — fragments.

  • Internal fragmentation: Typical paper book is a collection of pages (text divided into pages). When a chapter's end isn't located at the end of page and new chapter starts from new page, there's a gap between those chapters and it's a waste of space — a chunk (page for a book) has unused space inside (internally) — "white space"

  • External fragmentation: Say you have a paper diary and you didn't write your thoughts sequentially page after page, but, rather randomly. You might end up with a situation when you'd want to write 3 pages in row, but you can't since there're no 3 clean pages one-by-one, you might have 15 clean pages in the diary totally, but they're not contiguous

like image 24
poige Avatar answered Oct 05 '22 19:10

poige