Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

Internal Fragmentation in OS

The memory block that’s assigned to the processes is bigger. Thus, some portion of the memory is ultimately left unused since it can’t be utilised by another process. This causes internal fragmentation, and it can be reduced or lessened by effectively assigning the smallest of the partitions that are large enough for the given process.

In this article, we will look more into the Internal Fragmentation in OS according to the GATE Syllabus for (Computer Science Engineering) CSE. We will read ahead to find out more about it.

Table of Contents

What is Internal Fragmentation?

Whenever a memory block gets allocated with a process, and in case the process happens to be smaller than the total amount of requested memory, a free space is ultimately created in this memory block. And due to this, the memory block’s free space is unused. This is what causes internal fragmentation.

Internal Fragmentation

Most of the memory spaces are often reserved more than required so as to adhere to all the restrictions that regulate the storage space. For example, the memory can be supplied in the form of blocks (multiples of 4) only to the systems. Thus, as an outcome, when a program demands around 29B (bytes), it gets a coalition of 32B. This surplus storage would go to waste whenever this happens. Then the unused space can be found inside the assigned area in such cases. Such a structure, known as fixed segments, would struggle with excessive memory. So, any process would consume an enormous chunk, irrespective of how insignificant it might be. This very thing is termed as internal fragmentation. And unlike the other types of fragmentation, it’s practically impossible to typically restore internal fragmentation, and the only method to eliminate it is by using a new design.

Examples

For example, in the case of dynamic storage allocation, the storage reservoirs reduce internal fragmentation greatly by the extension of the space overhead over a significant amount of elements.

In the figure mentioned below, you can see internal fragmentation. Internal fragmentation is considered to be the distinction between the needed space or memory and the assigned storage space.

Internal-Fragmentation-in-OS

Let us look into another example. Assume that the memory allocation is done in RAM with the help of fixed partitioning. It means that memory blocks have fixed sizes. Here, 8MB, 4MB, 4MB, and 2MB are the sizes available. The OS uses a portion of this RAM.

Now let’s suppose a P1 process of 3MB size arrives, and it is given a 4MB memory block. Thus, as a result, the 1MB free space in this very block stays unused, and it can’t be used for the allocation of memory to another process. It is called internal fragmentation.

Internal-Fragmentation-in-OS

Avoiding Internal Fragmentation

The primary problem of internal fragmentation may occur because of the fixed memory block sizes. It can be solved by assigning spaces to the process through dynamic partitioning. Now, dynamic partitioning only allocates the amount of space that has been requested by the process. Thus, there is no internal fragmentation in this case.

Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus, GATE Previous Year Question Paper, and more.

Also Explore,