Fragmentation
Fragmentation
O.S O.S
8MB 8MB
4MB
8MB
6MB
8MB 8MB
8MB
16MB
8MB
8MB 8MB
8MB 14MB
• Performance lag
• allocation always occurs in a fixed size only, so the allocation becomes fast and simple.
BEST – FIT
This algorithm scans through the memory from the beginning to the end and
choose the block that is closest in size to the request.
Worst Fit
It allocates the process to the partition, which is the largest sufficient freely
available partition in the main memory.
NEXT FIT
This algorithm begins to scan the memory from the location of last placement
and choose the next available block that is large enough.
Similar to the First Fit
Searches for the first sufficient partition from the last allocation point
In satisfying a 16MB allocation request in the following figure
First – fit scans the memory and fit in a 22MB space leaving a 6MB hole.
Best – fit results in a 2MB fragment or hole in main memory.
Next – fit result in a 20MB fragment in main memory.
8MB 8MB
12MB 12MB
First - fit
22MB
6MB
Best - fit
18MB
2MB
Allocated Block
16MB Block
Possible New Allocation
6MB 6MB
14MB 14MB