Fragmentation in OS

Fragmentation in Operating System

Fragmentation refers to an undesirable problem that occurs in operating systems where processes are unloaded and loaded from memory and free space is fragmented. The process cannot be allocated a memory block due to its small size. Therefore, memory blocks always remain unused.
Producer Consumer Problem in OS

What is Fragmentation in OS

Memory space in the system constantly goes through loading and releasing processes and their resources because of which the total memory spaces gets broken into a lot of small pieces, this causes creation small non utilised fragmented memory spaces, which are so small that normal processes can not fit into those small fragments, causing those memory spaces not getting utilised at all, this is called memory Fragmentation in operating system.

Fragmentation is of the following two types –

  1. Internal Fragmentation
  2. External Fragmentation
Fragmentation in OS

Internal Fragmentation

Memory block that is given to the process can comfortably use the block but the size of the block announced, but it is way bigger than the memory process will require thus causing a that memory remaining unused for further processes.

Internal fragmentation

External Fragmentation

The memory space in the system can comfortably satisfy for the processes, but the available memory space is non-contiguous, thus it further can’t be utilised.

How to solve the fragmentation problem

Re-shuffling the utilised contents of the memory and placing all them together contiguously. Thus compacting the same and free spaces occur together and allocated spaces occur together, this is called compaction for External Fragmentation.

Internal Fragmentation has a few to effectively be reduced by intelligently assigning smaller partitions which though are large enough for the processes.

External fragmentation
Difference between internal and external fragmentation

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription