0% found this document useful (0 votes)
4 views

Fragmentation

Fragmentation in operating systems occurs when there are free memory blocks that are insufficiently contiguous to load a process, leading to external and internal fragmentation. External fragmentation arises when total free RAM is enough but not contiguous, while internal fragmentation occurs when fixed-sized blocks are larger than the process's needs. Solutions include segmentation, paging, and various memory allocation strategies such as first-fit, best-fit, and worst-fit.

Uploaded by

bca2m2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Fragmentation

Fragmentation in operating systems occurs when there are free memory blocks that are insufficiently contiguous to load a process, leading to external and internal fragmentation. External fragmentation arises when total free RAM is enough but not contiguous, while internal fragmentation occurs when fixed-sized blocks are larger than the process's needs. Solutions include segmentation, paging, and various memory allocation strategies such as first-fit, best-fit, and worst-fit.

Uploaded by

bca2m2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Fragmentation, External Fragmentation, Internal Fragmentation in

operating systems (OS)


The user of a computer continuously loads and unloads the processes from the main memory. Processes
are stored in blocks of the main memory. When it happens that there are some free memory blocks but
still not enough to load the process, then this condition is called fragmentation. Fragmentation is a
condition that occurs when we dynamically allocate the RAM (Read More about RAM) to the processes,
then many free memory blocks are available but they are not enough to load the process on RAM.

There are two types of fragmentation

1. External fragmentation
2. internal fragmentation

External fragmentation
Total free RAM space is enough to load a process but the process still can’t load because free blocks of
RAM are not contiguous. In other words, we can say that all free blocks are not located together. For
example, in the following diagram, we have a total 10 KB space free but it is not together located, so if a
process with 10KB size wants to loads on the RAM, then can’t load due to external fragmentation. But in
the diagram on the right side we can see that 10KB space is contiguously free, so here if a process of
10KB wants to load on the RAM then can execute.

Internal Fragmentation
Internal Fragmentation Internal fragmentation occurs when fixed sized memory blocks are available and
a process gets a block that is too much larger than the storage requirement of a process. The worst fit is
mostly a big reason for internal fragmentation.

Comparison of external fragmentation VS internal fragmentation


When different size memory blocks are dynamically allocated to the processes. Internal Fragmentation:
When fixed sized memory blocks are allocated to the processes.

Comparison of when fragmentation occurs External Fragmentation: When the process releases the
RAM, it creates the free space in the RAM which leads to cause external fragmentation.

Internal Fragmentation: When the memory assigned to the process is greater as compared to the
memory requested by the process.

Comparison of the solution of fragmentation External Fragmentation: Segmentation(Read More), paging


(Read More) and Compaction Internal Fragmentation: The memory must be partitioned into variable
sized blocks. Further, assign the best-fit block to the process. First-fit memory allocation In first-fit
memory allocation, OS Allocate the first hole to the process that is big enough and the process size is
less. Best-fit memory allocation In best-fit memory allocation, OS Allocate the most suitable smallest
hole to the process. In best-fit memory, waste is less as compared to the worst fit and first, fit memory
allocations. Worst-fit memory allocation In Worst-fit memory allocation, OS Allocate the largest hole to
the process and results in wastage of a large amount of memory. Fragmentation is a memory
management techniques
We can divide the memory management techniques into two main parts;

Uniprogramming

Multiprogramming

Uniprogramming
In uni-programming, the operating system divides them into two main parts. one part is dedicated to
the operating system and another part is dedicated to the user processes.

Multiprogramming
multiprogramming is a technique which allows multiple users to share the memory at the same time.
this is a very important feature of the operating system.

there are two types of possible memory allocations in multiprogramming;

contiguous memory allocation

noncontiguous memory allocation

Contiguous memory allocation contiguous memory means that all the free blocks of memory are closely
neighboured with each other.

Noncontiguous memory allocation Non-contiguous memory allocation means that all the free blocks of
memory are not closely neighboured with each other.

You might also like