0% found this document useful (0 votes)
86 views3 pages

Fragmentation in OS

Uploaded by

samiran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views3 pages

Fragmentation in OS

Uploaded by

samiran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Fragmentation

An unwanted problem with operating systems is fragmentation, which occurs when processes load and
unload from memory and divide available memory. Because memory blocks are so small, they cannot be
assigned to processes, and thus remain idle. It’s also important to realize that programs create free space
or holes in memory when they are loaded and unloaded. Because additional processes cannot be assigned
to these little pieces, memory is used inefficiently. The memory allocation scheme determines the
fragmentation circumstances.

Types of Fragmentation
There are two main types of fragmentation:
 Internal Fragmentation
 External Fragmentation

 Internal Fragmentation
When a process is allocated to a memory block, and if the process is smaller than the amount of
memory requested, a free space is created in the given memory block. Due to this, the free space of the
memory block is unused, which causes internal fragmentation.
For example, if a system allocates a 64KB block of memory to store a file that is only 40KB in size, that
block will contain 24KB of internal fragmentation.

 External Fragmentation
External fragmentation happens when a dynamic memory allocation method allocates some
memory but leaves a small amount of memory unusable. The quantity of available memory is substantially
reduced if there is too much external fragmentation. There is enough memory space to complete a
request, but it is not contiguous. It's known as external fragmentation.
Advantages
There are various advantages of fragmentation. Some of them are as follows:

Storage optimization
The fragmented systems might make potentially better use of the storage devices by using every storage
block available to us.

Fewer failures
If a system has insufficient sequential space, then it won’t support fragmentation and would ultimately fail.
No issues would arise.

Fast data writes


The data written in a system supporting data fragmentation can be faster than the reorganizing data
storage. It enables data writes in a contiguous manner.

Disadvantages
There are various disadvantages of fragmentation. Some of them are as follows:

Need for regular defragmentation


A more fragmented storage device's performance will degrade with time, necessitating the requirement for
time-consuming defragmentation operations.

Slower Read Times


The time it takes to read a non-sequential file might increase as a storage device becomes more
fragmented.

Fixed Partitioning
The earliest and one of the simplest technique which can be used to load more than one processes into the
main memory is Fixed partitioning or Contiguous memory allocation.

In this technique, the main memory is divided into partitions of equal or different sizes. The operating
system always resides in the first partition while the other partitions can be used to store user processes. The
memory is assigned to the processes in contiguous way.
In fixed partitioning,

1. The partitions cannot overlap.


2. A process must be contiguously present in a partition for the execution.

Dynamic Partitioning
Dynamic partitioning tries to overcome the problems caused by fixed partitioning. In this technique, the
partition size is not declared initially. It is declared at the time of process loading.

The first partition is reserved for the operating system. The remaining space is divided into parts. The size of
each partition will be equal to the size of the process. The partition size varies according to the need of the
process so that the internal fragmentation can be avoided.

You might also like