Javatpoint Logo
Javatpoint Logo

Internal vs. External Fragmentation

What is Fragmentation?

"Fragmentation is a process of data storage in which memory space is used inadequately, decreasing ability or efficiency and sometimes both." The precise implications of fragmentation depend on the specific storage space allocation scheme in operation and the particular fragmentation type. In certain instances, fragmentation contributes to "unused" storage capacity, and the concept also applies to the unusable space generated in that situation. The memory used to preserve the data set (- for example file format) is similar for other systems (- for example, the FAT file system), regardless of the amount of fragmentation (from null to the extreme).

There are three distinct fragmentation kinds: internal fragmentation, external fragmentation, and data fragmentation that can exist beside or a combination. In preference for enhancements, inefficiency, or usability, fragmentation is often acknowledged. For other tools, such as processors, similar things happen.

The Fundamental concept of Fragmentation

When a computer program demands fragments of storage from the operating system (OS), the elements are assigned in chunks. When a chunk of the software program is completed, it can be released back to the system, making it ready to be transferred to the next or the similar program again afterward. Software differs in the size and duration of time a chunk is kept by it. A computer program can demand and release several blocks of storage throughout its lifetime.

The unused memory sections are large and continuous when a system is initiated. The large continuous sectors become fragmented into a smaller part of the regions through time and utilization. Ultimately, accessing large contiguous blocks of storage can become difficult for the system.

Internal vs. External Fragmentation

Internal Fragmentation

Most memory space is often reserved than is required to adhere to the restrictions regulating storage space. For instance, memory can only be supplied in blocks (multiple of 4) to systems, and as an outcome, if a program demands maybe 29 bytes, it will get a coalition of 32 bytes. The surplus storage goes to waste when this occurs. The useless space is found inside an assigned area in this case. This structure, called fixed segments, struggles from excessive memory-any process consumes an enormous chunk, no matter how insignificant. Internal fragmentation is what this garbage is termed. Unlike many other forms of fragmentation, it is impossible to restore inner fragmentation, typically, the only way to eliminate it is with a new design.

For instance, in dynamic storage allocation, storage reservoirs reduce internal fragmentation significantly by extending the space overhead over a more significant number of elements.

Internal vs. External Fragmentation

The figure mentioned above demonstrates internal fragmentation because internal fragmentation is considered the distinction between the assigned storage space and the needed space or memory.

External Fragmentation

When used storage is differentiated into smaller lots and is punctuated by assigned memory space, external fragmentation occurs. It is a weak point of many storage allocation methodologies when they cannot effectively schedule memory used by systems. The consequence is that, while unused storage is available, it is essentially inaccessible since it is separately split into fragments that are too limited to meet the software's requirements. The word "external" derives from the fact that the inaccessible space is stored outside the assigned regions.

Consider, for instance, a scenario in which a system assigns three consecutive memory blocks and then relieves the middle block. The memory allocator can use this unused allocation of the storage for future assignments. Fortunately, if the storage to be reserved is more generous in size than this available region, it will not use this component.

In data files, external fragmentation often exists when several files of various sizes are formed, resized, and discarded. If a broken document into several small chunks is removed, the impact is much worse since this retains equally small free space sections.

Internal vs. External Fragmentation

You can see in the figure mentioned above that there is sufficient memory space (55 KB) to execute a process-07 (50 KB mandated), but the storage (fragment) is not adjacent. Here, to use the empty room to run a procedure, you can use compression, paging, or segmentation strategies.

Internal fragmentation vs. External fragmentation

Internal vs. External Fragmentation

Here, the differences between Internal and External Fragmentation are discussed below in the tabular format.

Sr. No. Internal Fragmentation External Fragmentation
1. Frames square measure designated for processing in internal fragmentation of fixed-sized storage. Variable-sized memory frames square measure designated to the process during external fragmentation.
2. When the system or procedure is greater than the storage, internal fragmentation occurs. Whenever the system or procedure is withdrawn, external fragmentation occurs.
3. The internal fragmentation approach is the frame with the perfect match. Compression, paging, and differentiation are alternatives to external fragmentation.
4. Internal fragmentation happens whenever the storage is split into fragments of a fixed length. External fragmentation happens whenever the storage is split into segments of variable size depending on the process length.
5. The distinction between the assigned memory and the storage or memory needed is considered as internal fragmentation. The empty spaces created among non-contiguous pieces of storage are too tiny for a new system to operate, considered as external fragmentation.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA