• Networking
  • Programming
  • DBMS
  • Operating System
  • Internet
  • Hardware
  • Software

Tech Differences

Know the Technical Differences

Difference Between Internal and External fragmentation

internal-vs-external-fragmentationWhenever a process is loaded or removed from the physical memory block, it creates a small hole in memory space which is called fragment. Due to fragmentation, the system fails in allocating the contiguous memory space to a process even though it have the requested amount of memory but, in a non-contiguous manner. The fragmentation is further classified into two categories Internal and External Fragmentation.

Both the internal and external classification affects data accessing speed of the system. They have a basic difference between them i.e. Internal fragmentation occurs when fixed sized memory blocks are allocated to the process without concerning about the size of the process, and External fragmentation occurs when the processes are allocated memory dynamically.

Let us move further and discuss the differences, reasons, solutions behind internal and external fragmentation with the help of comparison chart shown below.

Content: Internal Vs External Fragmentation

  1. Comparison Chart
  2. Definition
  3. Key Differences
  4. Conclusion

Comparison Chart

Basis for Comparison Internal FragmentationExternal Fragmentation
BasicIt occurs when fixed sized memory blocks are allocated to the processes.It occurs when variable size memory space are allocated to the processes dynamically.
OccurrenceWhen the memory assigned to the process is slightly larger than the memory requested by the process this creates free space in the allocated block causing internal fragmentation.When the process is removed from the memory, it creates the free space in the memory causing external fragmentation.
SolutionThe memory must be partitioned into variable sized blocks and assign the best fit block to the process.Compaction, paging and segmentation.

Definition of Internal Fragmentation

Internal fragmentation occurs when the memory is divided into fixed sized blocks. Whenever a process request for the memory, the fixed sized block is allocated to the process. In case the memory assigned to the process is somewhat larger than the memory requested, then the difference between assigned and requested memory is the Internal fragmentation.

This leftover space inside the fixed sized block can not be allocated to any process as it would not be sufficient to satisfy the request of memory by the process. Let us understand Internal fragmentation with the help of an example. The memory space is partitioned into the fixed-sized blocks of 18,464 bytes. Let us say a process request for 18,460 bytes and partitioned fixed-sized block of 18,464 bytes is allocated to the process. The result is 4 bytes of 18,464 bytes remained empty which is the internal fragmentation.

The overhead of keeping track of the internals hole created due to internal fragmentation is substantially more than the number of internal holes. The problem of internal fragmentation can be solved by partitioning the memory into the variable sized block and assign the best-sized block to a process requesting for the memory. Still, it will not totally eliminate the problem of internal fragmentation but will reduce it to some extent.

Definition of External Fragmentation

External fragmentation occurs when there is a sufficient amount of space in the memory to satisfy the memory request of a process. But the process’s memory request can not be satisfied as the memory available is in a non-contiguous manner. Either you apply first-fit or best-fit memory allocation strategy it will cause external fragmentation.

When a process is loaded and removed from the memory the free space creates the hole in the memory space, and there are many such holes in the memory space, this is called External fragmentation. Although the first fit and best fit can affect the amount of external fragmentation, it can not be totally eliminated. Compaction may be the solution for external fragmentation.

Compaction algorithm shuffles all memory contents to one side and frees one large block of memory. But compaction algorithm is expensive. There is an alternative solution to solve external fragmentation issue which will allow a process to acquire physical memory in a non-contiguous manner. The techniques to achieve this solution are paging and segmentation.

Key Differences Between Internal and External fragmentation

  1. The basic reason behind the occurrences of internal and external fragmentation is that internal fragmentation occurs when memory is partitioned into fixed-sized blocks whereas external fragmentation occurs when memory is partitioned into variable size blocks.
  2. When the memory block allotted to the process comes out to be slightly larger than requested memory, then the free space left in the allotted memory block causes internal fragmentation. On the other hands, when the process is removed from the memory it creates free space causing a hole in the memory which is called external fragmentation.
  3. The problem of internal fragmentation can be solved by partitioning the memory into variable sized blocks and assign the best fit block to the requesting process. However, the solution for external fragmentation is compaction, but it is expensive to implement, so the processes must be allowed to acquire physical memory in a non-contiguous manner, to achieve this the technique of paging and segmentation is introduced.

Conclusion

The problem of internal fragmentation can be reduced, but it can not be totally eliminated. The paging and segmentation help in utilising the space freed due to external fragmentation by allowing a process to occupy the memory in a non-contiguous manner.

Related Differences:

  1. Difference Between Contiguous and Noncontiguous Memory Allocation
  2. Difference Between Paging and Segmentation in OS
  3. Difference Between Paging and Swapping in OS
  4. Difference Between malloc and calloc
  5. Difference Between FAT32 and NTFS

Comments

  1. Fissionix says

    May 17, 2017 at 12:46 pm

    Best difference ever seen..
    Ultimate description..

    Reply
  2. Atanu Mondal says

    December 3, 2017 at 1:22 pm

    Very clear and compact explanation. No more words to say.

    Reply
  3. pranav.pk says

    March 20, 2018 at 5:27 pm

    Use full .thank you

    Reply
  4. Supriya pandey says

    April 2, 2018 at 2:59 pm

    Really very useful….compact…

    Reply
  5. Vishnu says

    October 4, 2018 at 5:00 pm

    Very good explanation

    Reply
  6. bothwell says

    October 22, 2018 at 5:03 pm

    great and clear

    Reply
  7. Mayurii says

    November 25, 2018 at 5:06 pm

    Clear all views

    Reply
  8. Ravi Kumar says

    December 4, 2018 at 2:52 pm

    Great, it clears my concept.

    Reply
  9. Vaibhav Katare says

    December 6, 2018 at 4:11 am

    Ultimate explanation 👌👌

    Reply
  10. Amit says

    December 14, 2018 at 5:16 pm

    That’s too good

    Reply
  11. Nasruddiin Abdulwahaab says

    August 25, 2019 at 8:49 am

    Thanks very much.

    Reply
  12. Diksha Sharma says

    February 17, 2020 at 5:24 pm

    Easily understandable
    Thanks

    Reply
  13. Aman says

    May 4, 2020 at 12:00 pm

    thanks you so much for this

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top 10 Differences

  • Difference Between OLTP and OLAP
  • Difference Between while and do-while Loop
  • Difference Between Guided and Unguided Media
  • Difference Between Preemptive and Non-Preemptive Scheduling in OS
  • Difference Between LAN, MAN and WAN
  • Difference Between if-else and switch
  • Difference Between dispose() and finalize() in C#
  • Difference Between for and while loop
  • Difference Between View and Materialized View
  • Difference Between Server-side Scripting and Client-side Scripting

Recent Addition

  • Difference Between Java and Python
  • Difference Between PHP and HTML
  • Difference Between GPS and GNSS 
  • Difference Between Virtualization and Containerization
  • Difference Between Storage and Memory

Categories

  • Artificial Intelligence
  • DBMS
  • Hardware
  • Internet
  • Networking
  • Operating System
  • Programming
  • Software

Copyright © 2025 · Tech Differences · Contact Us · About Us · Privacy