user1849908
user1849908

Reputation:

How does external fragmentation happen?

As processes are loaded and removed from memory , the free memory space is broken into little pieces ,causing fragmentation ... but how does this happen ? And what is the best solution to external fragmentation ?

Upvotes: 5

Views: 37063

Answers (4)

Jazib_Prince
Jazib_Prince

Reputation: 39

The best solution to avoid external fragmentation is Paging. Paging is a memory management technique usually used by virtual memory operating systems to help ensure that the data you need is available as quickly as possible. for more see this : What's the difference between operating system "swap" and "page"?

In case of Paging there is no external fragmentation but it doesn't avoid internal fragmentation.

Upvotes: 1

stephen
stephen

Reputation: 21

External fragmentation can be reduced by compaction or shuffle memory contents to place all free memory together in one large block. To make compaction feasible, relocation should be dynamic.External fragmentation is also avoided by using paging technique.

Upvotes: 2

shamim
shamim

Reputation: 49

External fragmentation exists when there is enough total memory to satisfy a request (from a process usually), but the total required memory is not available at a contiguous location i.e, its fragmented.

Solution to external fragmentation :

1) Compaction : shuffling the fragmented memory into one contiguous location.

2) Virtual memory addressing by using paging and segmentation.

Upvotes: 4

Ravindra Bagale
Ravindra Bagale

Reputation: 17655

External Fragmentation

External fragmentation happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used. If too much external fragmentation occurs, the amount of usable memory is drastically reduced. Total memory space exists to satisfy a request, but it is not contiguous. see following example

 0x0000 0x1000  0x2000  
   A    B     C               //Allocated three blocks A, B, and C, of size 0x1000.
   A          C         //Freed block B

Now Notice that the memory that B used cannot be included for an allocation larger than B's size

Upvotes: 5

Related Questions