How Internal Fragmentation is Caused?

When a process requests memory for working, most systems allocate the memory in fixed-sized blocks or pages. In most cases, the memory block that is being allocated is bigger than the amount of memory requested by the process. This is the main reason why Internal Fragmentation is caused.

In some scenarios, a constant amount of memory is allocated to every process requesting for memory. Processes that request/require memory less than that of the constant amount end up wasting a good amount of allocated memory. This also ends up causing Internal Fragmentation.

In some systems, memory is managed by tracking the allocated blocks of memory using some data structure ends up creating some memory overhead. This memory which is wasted to store and manage the data structure which is the tracker of the engaged memory ends up in Internal Fragmentation.

Example:

Let’s assume that the system that is being used assigns the memory in blocks of sizes being multiples of 4(like 12, 24, 32,..). In this system when a process P1 requests an amount of memory that is not a multiple of 4, it is assigned a memory block of value of the nearest higher multiple.

For example, in this system if a process P1 requests a memory of 29kb, as it is not a multiple of 4 the process is assigned a memory of size 32kb as this is a multiple of 4. Now, the process will only use 29kb of memory, and the rest of the memory goes wasted. This wasted memory results in internal fragmentation.

Internal Fragmentation in OS

Internal Fragmentation is a problem that occurs due to poor memory allocation and it results in wastage of memory. When a process is loaded into the system it requests memory which is essential for its working. The operating system allocates memory to processes to work with but if the memory happens to be smaller and bigger than the process requirement the extra space goes unused. This small amount of memory unutilization is the major Internal Fragmentation appearing in the Operating System.

Similar Reads

How Internal Fragmentation is Caused?

When a process requests memory for working, most systems allocate the memory in fixed-sized blocks or pages. In most cases, the memory block that is being allocated is bigger than the amount of memory requested by the process. This is the main reason why Internal Fragmentation is caused....

Effect of Internal Fragmentation

Due to Internal Fragmentation various types of effects occurs:...

Why Internal Fragmentation is Allowed?

As Internal Fragmentation is nothing but a problem there isn’t any significant advantage that it provides to the system. But there are a couple of things that favor causing it, which are:...

Ways to Avoid Internal Fragmentation

There are several ways to avoid Internal fragmentation. Some of them are mentioned below....

FAQs on Internal Fragmentation

1. What causes Internal Fragmentation in OS?...